Friday 9 June 2017

net.request post data not working

Posting data using net.request is not working. It's reaching the URL. But data not posted. My code is below. Please help me on this.

const net = remote.net;
const querystring = require('querystring');

//**
var postData = querystring.stringify({
    'username' : 'test',
    'password': 'test'
});

const request = net.request({
  method: 'POST',
  url: 'http://127.0.0.1/post.php',
});

request.write(postData);    



via Jay

No comments:

Post a Comment