node-oauth icon indicating copy to clipboard operation
node-oauth copied to clipboard

POST with query and body

Open reggi opened this issue 13 years ago • 1 comments

In the quickbooks API there exists a request to delete a customer. The request uses both a query parameter and a xml body. How can I do this using the oauth module?

reggi avatar Sep 01 '12 01:09 reggi

I guess it's too late for answering this, but since I was struggling with something similar until now, here it goes:

var request = new oauth.OAuth(token, token_secret, key, secret, '1.0', null, 'HMAC-SHA1');
var url = "http://url?with&query&params";
var body = "<root>XML test</root>";
request.post(url, requestUrl, accessUrl, body, 'application/xml', function(err, data, res) {
});

I adapted it from my example which uses json instead of xml. Hope it helps!

bertop89 avatar May 24 '16 09:05 bertop89