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
Default Client does not include Content-Length header for POST with Empty Body #1229
We are using Feign 10.7.4 to execute a POST request with an empty body. In this case Feign does not add a Content-Length header to the request. According to the HTTP specification this is fine but some proxies, in our case Azure API Management, do not accept POST request with no Content-Length header. Would it be possible to add a Content-Length: 0 header to PATCH, POST and PUT requests with an empty body?
In this case, only the default Client implementation is out of compliance. I'm going to update the title of this issue to reference that class and mark this as a bug.
changed the title [-]No Content-Length header for POST request with an empty body[/-][+]Default Client does not include Content-Length header for POST with Empty Body[/+]on Dec 29, 2020
If you are using POST/PUT method with RequestParam, instead of this, try using Request body, cause with empty body Feign Client will send Content-Length: 0, and you will face "Length Required" problem
Activity
velo commentedon May 19, 2020
Should be a simple change around this
https://github.com/OpenFeign/feign/blob/master/core/src/main/java/feign/Client.java#L189
What client are you using? Default one? if so, i gave you the correct link.
brennerm commentedon May 20, 2020
We are including spring-cloud-openfeign so I suppose we use the FeignBlockingLoadBalancerClient client class.
kdavisk6 commentedon May 30, 2020
@brennerm can you please confirm with the Spring Cloud team that they are passing this through to us first?
kdavisk6 commentedon Dec 29, 2020
In this case, only the default
Clientimplementation is out of compliance. I'm going to update the title of this issue to reference that class and mark this as a bug.[-]No Content-Length header for POST request with an empty body[/-][+]Default Client does not include Content-Length header for POST with Empty Body[/+]ameenudheenirshad commentedon May 11, 2021
Is there any workaround for this??
MazizEsa commentedon May 29, 2021
@kdavisk6 still need help for this?
raphmello commentedon Aug 16, 2021
I had the same problem, and solved sending an empty string.
Yerden01 commentedon Nov 1, 2021
If you are using POST/PUT method with RequestParam, instead of this, try using Request body, cause with empty body Feign Client will send Content-Length: 0, and you will face "Length Required" problem
alexey-plotnikoff commentedon Dec 16, 2021
Have the same problem
tcolombo08 commentedon Jul 11, 2022
Also having this issue. Any idea on an ETA of a fix?
velo commentedon Jul 11, 2022
hi @tcolombo08 feign is mainly driven by volunteer work. ETA depends on someone that is affected by this issue getting involved.