node-request-caching icon indicating copy to clipboard operation
node-request-caching copied to clipboard

POST for objects

Open mangvlad opened this issue 12 years ago • 1 comments

I am trying to do a POST where request body has to be:

{keys: [1,2,3,4]}

When I set params to this, what gets posted is:

keys=1&keys=2&keys=3&keys=4

(my object turned into query string).

Any easy way to change this?

mangvlad avatar Jun 18 '13 21:06 mangvlad

I think the fix can be on line 57 of the request-caching.js:

  //options.paramsStringified = querystring.stringify(options.params);
  options.paramsStringified = JSON.stringify(options.params);

mangvlad avatar Jun 18 '13 21:06 mangvlad