Skip to content

Instantly share code, notes, and snippets.

@madpilot
Created July 19, 2010 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madpilot/480932 to your computer and use it in GitHub Desktop.
Save madpilot/480932 to your computer and use it in GitHub Desktop.
// Create a file on your desktop, enter the code, and then open it LOCALLY in your browser
// This works...
var http = new XMLHttpRequest();
var url = "http://www.need-a-real-url.com";
var params = "<data></data>";
http.open("POST", url, true);
http.send(params);
// This doesn't...
var http = new XMLHttpRequest();
var url = "http://www.need-a-real-url.com";
var params = "<data></data>";
http.open("POST", url, true);
http.setRequestHeader('Content-Type', 'application/xml');
http.send(params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment