Skip to content
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

json option no longer work with got.stream.post #950

Closed
2 tasks done
sylvaindumont opened this issue Dec 1, 2019 · 1 comment
Closed
2 tasks done

json option no longer work with got.stream.post #950

sylvaindumont opened this issue Dec 1, 2019 · 1 comment
Labels
bug Something does not work as it should

Comments

@sylvaindumont
Copy link

Describe the bug

  • Node.js version: 12.13.0
  • OS & version: Ubuntu 19.10

got.stream.post no longer works with json option since #921

Actual behavior

a body is set in asStream
the request now have a body and a json option and throw in normalizeRequestArguments

Expected behavior

the json argument should work with got.stream.post, as it did until #921

Code to reproduce

got.stream.post('https://sindresorhus.com',  {json: {}})

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
@szmarczak szmarczak added the bug Something does not work as it should label Dec 1, 2019
@szmarczak
Copy link
Collaborator

szmarczak commented Dec 1, 2019

if (options.body) {

Should be options.body || options.json || options.form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as it should
Projects
None yet
Development

No branches or pull requests

2 participants