Http Post In Javascript In Firefox Extension
I'm a newbie trying to do a simple HTTP post in JS within a Firefox extension.. This isn't passing through the parameters: var params = 'a=1&b=2&c=3' req.open('POST', 'http
Solution 1:
Make sure you've included the header to tell the server what type of request body you're sending it:
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
(Assuming req
is an XMLHttpRequest
created earlier in the code.)
Solution 2:
Solution 3:
You don't need an extension, plain JavaScript can do this:
Post a Comment for "Http Post In Javascript In Firefox Extension"