Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request using POST #26

Open
xyboox opened this issue Feb 22, 2014 · 2 comments
Open

Request using POST #26

xyboox opened this issue Feb 22, 2014 · 2 comments

Comments

@xyboox
Copy link

xyboox commented Feb 22, 2014

Hello,

I can't find anything about this in the provided documentation. Is it possible to make POST requests ( and send along some parameters )?
Thanks!

@dpedpe
Copy link

dpedpe commented Nov 24, 2014

I have the same question - any examples?

@svlapin
Copy link

svlapin commented Nov 29, 2014

According to http://curl.haxx.se/libcurl/c/curl_easy_setopt.html

var qs = require('querystring');
var curl = require('node-curl');

var opts = {
  POST: 1,
  POSTFIELDS: qs.stringify({
    fleld1: someValue1,
    field2: someValue2
  })
};

curl(targetUrl, opts, function(err) {
  console.log(this.body);
});

This should print body of the HTTP response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants