3

The following code is working very well.

request
  .post(url)
  .query(query)
  .end(cb); // The callback will be called with parameters err and res

But when I changed .query() to .send() to pass the input values as form-data instead of query-string-parameters, the Request Method was changed from POST to OPTIONS and generating the error which might from the browser(Chrome) before sending the request to the server.

request
  .post(url)
  //.query(query)
  .send({"a":"a"})
  .end(cb); // The callback will be called with parameters err and res

Please help me how to fix it. Thank you in advance!

Eunmee Yi
  • 31
  • 2

0 Answers0