Last active
August 29, 2015 14:18
-
-
Save umiyosh/c079526d01d289186992 to your computer and use it in GitHub Desktop.
jsのやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>XHR Test</title> | |
</head> | |
<body> | |
<script> | |
function request() { | |
var xhr = new XMLHttpRequest(); | |
var content = [ | |
"Service=AWSECommerceService", | |
"AWSAccessKeyId=AWSACCESSKEY", | |
"Operation=SellerListingSearch", | |
"SellerId=SELLERID", | |
"Title=TITLE", | |
"OfferStatus=Closed", | |
]; | |
xhr.open("POST", "http://ecs.amazonaws.com/onca/xml", true); | |
xhr.onreadystatechange = function(e) { | |
if (this.readyState == 4) { | |
document.write("<p>body:" + this.responseText + "</p>"); | |
document.write("<p>status:" + this.status + "</p>"); | |
} | |
}; | |
xhr.send(content.join("&")); | |
} | |
window.onload = function () { | |
request(); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment