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
When a POST request is sent with an empty body, and Bind is called to bind param values, it fails with 415 unsupported media type.
I sent this request from browser and observed that Content-Length = 0 header is actually being sent, but on the server this header seems to be stripped out of headers, and ContentLength on the request object is set to -1, causing the request content length to be treated as unknown, and causing Bind method to fail.
I am aware I can just use c.Param or just sent an empty json etc. but this failing felt off so wanted to share it.