Skip to content
Advertisement

Howto send PUT request without content and Content-Length header with Apache http client?

I’d like to test (via automated test) how server (and all proxies in-the-middle) responds to a PUT request without body and Content-Length header.

Similar to what curl does

JavaScript

with Apache HTTP client (4.5.13)

But it looks like it always adds Content-Length header if I specify no body. Is there any way to do that with Apache HTTP client?

Already tried (no luck)

JavaScript

Advertisement

Answer

Use a request interceptor to modify requests generated by the standard protocol processor

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement