ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
891 stars 232 forks source link

Empty String for Body #211

Closed randysecrist closed 4 years ago

randysecrist commented 4 years ago

Just a question ...

Is it possible to use a empty string ("") as a post body with gun? I wrote a test case the other day using gun and if I recall correctly gun:await was returning {:error, :timeout} ... so I ended up skipping that test case...

(note cowboy handles empty string just fine - (curl -d "" works); it seems to be just client side using gun)

essen commented 4 years ago

In the 1.x version there was a design issue that could cause confusion, if you used an empty body but had a content-type or similar header Gun still expected a body afterwards. This is fixed in 2.0.0-pre.1.