pass JSON to HTTP POST Request

后端 未结 9 2088
傲寒
傲寒 2020-11-29 18:22

I\'m trying to make a HTTP POST request to the google QPX Express API [1] using nodejs and request [2].

My code l

9条回答
  •  孤街浪徒
    2020-11-29 19:04

           var request = require('request');
            request({
                url: "http://localhost:8001/xyz",
                json: true,
                headers: {
                    "content-type": "application/json",
                },
                body: JSON.stringify(requestData)
            }, function(error, response, body) {
                console.log(response);
            });
    

提交回复
热议问题