मुझे पता है, कैसे उदाहरण के लिए, पेलोड में json अनुरोध पारित करने के लिए करना चाहता था में json डेटा पास जाना चाहिएमैं कैसे http पोस्ट अनुरोध के अनुरोध पेलोड
var post_data = {};
var post_options = {
host: this._host,
path: path,
method: 'POST',
headers: {
Cookie : "session=" + session,
'Content-Type': 'application/json',
'Content-Length': post_data.length,
}
};
// Set up the request
var post_req = http.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('========Response========: ' + chunk);
});
});
// post the data
post_req.write(post_data);
post_req.end();
धन्यवाद में मदद करता है के लिए। Prats
क्या यह आपके प्रश्न का उत्तर देता है? http://stackoverflow.com/questions/4505809/how-to-post-to-a-request-using-node-js – exclsr