How to use a message in the Request function in firefox-addon-sdk

I read about the Request function as this link: https://addons.mozilla.org/en-US/developers/docs/sdk/1.1/packages/addon-kit/docs/request.html

And I would like to use the post method. There are no explanations or examples of how to send a variable from JS to my server using the post method. How can i do this?

+6
source share
1 answer

You simply change the get () call in the example on this page using post ().

exports.main = function() { var Request = require("request").Request; Request({ url: "http://google.com/", content: {q: "test"}, onComplete: function (response) { console.log(response.text); } }).post(); }; 
+10
source

Source: https://habr.com/ru/post/899917/


All Articles