how to use post in “Request” function at firefox-addon-sdk

前端 未结 1 2001
囚心锁ツ
囚心锁ツ 2021-02-06 11:36

I read about function \'Request\' 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 th

1条回答
  •  醉梦人生
    2021-02-06 11:57

    You just change the get() call in the example on that page with 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();
    };
    

    0 讨论(0)
提交回复
热议问题