-
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
adding content_type_json() to a POST no longer works with v0.5 #140
Comments
Could you please provide a reproducible example? (Also you can now do |
Unfortunately, the API I am programming against is not publicly available. |
unfortunately, I also cannot use the |
Yeah, you'd have to use The output is identical for me: > httr::content_type_json()
Config:
List of 1
$ httpheader:"application/json"
..- attr(*, "names")="Content-type"
> httr::add_headers('Content-Type' = "application/json")
Config:
List of 1
$ httpheader:"application/json"
..- attr(*, "names")="Content-Type" (modulo case, which doesn't matter, and hasn't changed in 0.5) |
The output is the same for me as well, however, when I use it in POST it does not behave the same. If I put |
Hi Hadley, I think I have found the problem. I will see if I can fix it myself.
which results in |
Oh hmmm, so the reason that |
I used to create a POST as follows:
POST(url = <URL>, body = <some json>, content_type_json())
However, using v0.5 this no longer works, however using:
POST(url = <URL>, body = <some json>, add_headers('Content-Type' = "application/json"))
Does work.
The text was updated successfully, but these errors were encountered: