-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RESTDataSource - POST body as array #2196
Comments
I've temporary fixed this by setting the content type header in de post: async addMultipleItems({ input = [{...}, {...}, ...] }: any) {
return this.post('/items', JSON.stringify(input), {
headers: {
'Content-Type': 'application/json',
},
})
} But if this is done in |
4 tasks
abernix
added a commit
that referenced
this issue
Feb 5, 2019
Fixes issue introduced in #1125 and logged in #2186 and #2196. Arrays are valid JSON per spec: https://tools.ietf.org/html/rfc7159
This appears to be resolved by #2219 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There seems to be a problem when trying to send an array as body with the RESTDataSource post call.
When trying to execute following function, the endpoint receives an empty body in the request.
The
res.body
of the endpoint should contain[{...}, {...}, ...]
but contains{}
.Any help?
The text was updated successfully, but these errors were encountered: