Skip to content

Instantly share code, notes, and snippets.

@umiyosh
Last active August 29, 2015 14:18
Show Gist options
  • Save umiyosh/c079526d01d289186992 to your computer and use it in GitHub Desktop.
Save umiyosh/c079526d01d289186992 to your computer and use it in GitHub Desktop.
jsのやつ
<!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