You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hesitate to call this a bug in HTTR, but it certainly is an issue: r-lib/httr#159
That has some workarounds to use a different JSON,
It also seems like:
httr::POST('https://api.hipchat.com/v2/rooms/room_id/notification?auth_token=token',
body = jsonlite::toJSON(list(message = 'hello hipchat'),auto_unbox=TRUE),
httr::content_type_json())
Would work without switching encoders to rjson. It doesn't seem like anyone is interested in fixing this, but "I refuse to treat single item lists the same as literals, because my language chooses to treat literals as single item lists" doesn't seem like an argument that holds much water.
Since workarounds exist, I'm going to wontfix this.
You're welcome to joint he discussion and argue about which defaults you would like to see, or how we can make it easier to set toJSON parameters in httr.
R treats everything as a vector so when httr JSON encodes list("geopoint"=list("type"="exists")) the result is
This returns a 400 invalid request. The JSON with "exists" works fine.
The text was updated successfully, but these errors were encountered: