request / request-promise

The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.
ISC License
4.77k stars 297 forks source link

Array in body #328

Closed ikirja closed 4 years ago

ikirja commented 4 years ago

Hi!

I was wondering if it's possible to send array in body of the request?

I need to send options like this let options = { method: 'POST', uri: uri, body: [ 'some-string', 'some-string-2 ]

ikirja commented 4 years ago

Ok guys I've made it to work. All I did is changed body to json.

let options = { method: 'POST', uri: uri, json: [ 'some-string', 'some-string-2 ]

And headers let headers = { 'Content-Type': 'application/json' }

Worked for me!