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 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
Tag: apache-httpclient-4.x
Apache HttpClient Keep-Alive Strategy for active connections
In an Apache HttpClient with a PoolingHttpClientConnectionManager, does the Keep-Alive strategy change the amount of time that an active connection will stay alive until it will be removed from the connection pool? Or will it only close out idle connections? For example, if I set my Keep-Alive strategy to return 5 seconds for every request, and I use the same
Using google-http-client and google-http-client-apache-v2 behind a proxy produces NonRepeatableRequestException
I’m using google-http-client and google-http-client-apache-v2 libraries to make a POST request behind a proxy. That request produces a NonRepeatableRequestException: It seems like ApacheHttpRequest wraps ByteArrayContent that is repeatable (see JavaDoc) inside a ContentEntity that is non-repeatable. Debuging execution inside google libraries, proxy is returning “407 Proxy Authentication Required”, then it tries to repeat the request (guess that including the credentials)
Self signed certificate issue in Apache HttpClient [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I have a self signed certificate for a website. I imported it into java cacert file using keytool. After that, it is working well with
How to set TCP keep Alive from HttpClient?
My Java application which resides in AWS private subnet connects to an http server via AWS Nat gateway. I am calling a POST request via HttpClient to the HTTP server. That request will take more than 10 minutes to complete. I have configured a socket time out and connection timeout of 1 hour as this this a background task .
Can’t turn off HttpClient Wire debug log messages
I have been trying to set Wire to not send DEBUG to console, but no matter what I do, it won’t listen. I have log4j initialized properly: I do not get any appender messages, log4j is obeying my class and console levels. In log4j.properties I have every foreseeable way to write wire: I then thought why not print all loggers
Apache HttpClient – Log version of TLS that’s negotiated in a request?
I’ve got lots of code that uses Apache’s HttpClient, and I’d like to log the version of TLS that’s being negotiated when a request is made. Is this possible? I’d prefer an approach that doesn’t requiring changing how the request is being built, if possible – something that inspects a response or views a log or something like that? From
Apache Http Client 4 Form Post Multi-part data
I need to post some form parameters to a server through an HTTP request (one of which is a file). So I use Apache HTTP Client like so… The server returns an error, stack trace is.. I understand from other posts that I need to somehow come up with a boundary, which is a string not found in the content.
After upgrading to Apache HttpClient 4.4 it does not send cookies with requests
I am using the Apache HttpClient to send requests to our internal API servers. The servers require authentication and need a cookie to be set with an auth token. Up to HttpClient 4.3.6 this has been working fine, but on 4.4 and above it has stopped sending the cookies on requests. My cookie domain is set to .subdomain.mycompany.com, which works
How can I create an empty dummy HttpResponse
I am using org.apache.http.HttpResponse I want to create an empty dummy resposne, I am going to use this to return when errors occur instead of passing back null. I tried to create one and it has lost of weird params. Can someone tell me how to create one. Answer Just implement HttpResponse with no-op methods.