node-oauth
node-oauth copied to clipboard
POST with query and body
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?
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¶ms";
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!