-
Notifications
You must be signed in to change notification settings - Fork 96
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: true sends "true" as request body no matter what #134
Comments
json: true
sends true
as request body no matter what
Hey, sorry if this is late to the party, or if I missed anything somewhere in #136, but it seems to me like this not working is a bug in the current branch that can be fixed before a major version bump. Something like this could fix it until #135 goes through: body = JSON.stringify(options.json === true ? body : options.json) This bug blocks a bunch of legitimate use cases (body-less DELETE requests which expect json back, for example) in the 2.0 branch, and so I think holding up a release here is a mistake, but that is just my personal opinion. I can submit the PR for this if it seems like a good change |
Very good point. Would you by any chance like to contribute a testcase for that? I'll look into it more tomorrow. |
Done, #139 |
Looks like you have it all covered? Let me know if you need anything else to help out! Otherwise good work!! |
…equest Align json option with request, improved to include input from #134 comments
merged, releasing 2.3.0 |
will post
true
as request body.It even sends
false
as request body if passingjson: false
.According to
request
docs, the json flag is only used as a modifier tobody
:The text was updated successfully, but these errors were encountered: