I am new to node.js, i am using request, post request.but, i got error!
request({ method: 'POST', url: config.api + '/index', body: { name: "name" }, json: true }) throw er; // Unhandled 'error' event ^ Error: Invalid protocol: 127.0.0.1:
I write this: it works fine, you can change it like this.
request({ method: 'POST', url: 'http://127.0.0.1:3000' + '/index', body: { name: "name" }, json: true })
Your code is incorrect: follow the instructions on the page .