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
{{ message }}
Repository navigation
POST requests with empty body have "Content-Type: application/x-www-form-urlencoded" header since Feign 12.0 #2068
In Feign 11.10 when a request has no body, Feign’s Client does not send anything to outputStream (code), and JDK class HttpUrlConnection does not add Content-type in this case (the if here does not match because poster == null)
In Feign >= 12.0 when a request has no body and the request method is POST, Feign’s Client sends an empty array to outputStream (code), and JDK class HttpUrlConnection adds Content-type in this case (the if here matches because poster != null)
The change that modifies the behavior is described as a bugfix for the lack of Content-Length header for POSTs with an empty body - issue #1229, PR #1778. It indeed adds Content-Length, but also the Content-Type.
Activity
Avoid default Content-Type on POST/PUT/PATCH with empty body