Gets the current state of the cookie jar.
Gets the current state of the cookie jar. If multiple threads are executing, this will return a snapshot of the state at some instant.
Make a DELETE request with cookies.
Make a DELETE request with cookies.
Make a DELETE request.
Make a DELETE request. No cookies are used and none are returned.
Makes an arbitrary request using a response builder.
Makes an arbitrary request using a response builder. After this call, the response builder will provide the response.
the request
the response factory, e.g. new BufferedResponseBuilder
the particular configuration being used for this request; defaults to the commonConfiguration supplied to this instance of HttpClient
(or ConnectException subclass) if an IO exception occurred
IllegalStateExceptionif the maximum redirects threshold was exceeded
Make a GET request with cookies.
Make a GET request with cookies.
Make a GET request.
Make a GET request. No cookies are used and none are returned.
Make a HEAD request with cookies.
Make a HEAD request with cookies.
Make a HEAD request.
Make a HEAD request. No cookies are used and none are returned.
Makes an arbitrary request and returns the response, which contains the entire response body in a buffer.
Makes an arbitrary request and returns the response, which contains the entire response body in a buffer. All the convenience methods (head, get, put, post, trace, options) use this buffered method.
It is the 'normal' way to make HTTP requests. Bit it may be inappropriate when the response body is too large to be buffered in memory, or if it is desirable to start processing the body whilst it is still being read in, in which case use 'makeUnbufferedRequest' instead.
the request
the particular configuration being used for this request; defaults to the commonConfiguration supplied to this instance of HttpClient
the response (for all outcomes including 4xx and 5xx status codes) if no exception occurred
(or ConnectException subclass) if an IO exception occurred
Makes an arbitrary request and returns a the response.
Makes an arbitrary request and returns a the response. For successful 200-OK responses, this will be an *unbuffered* response with direct access to the source input stream. This allows bespoke usage of this stream. It is the caller's responsibility to ensure that the stream is always closed, so preventing leakage of resources. This is made easier because the stream is of a kind that will automatically close as soon as all the data has been read.
For all responses other than 200-OK, a buffered response is returned, as if makeRequest
had been used instead.
This ensures that the input stream is automatically closed for all error, redirection and no-content responses.
the request
the particular configuration being used for this request; defaults to the commonConfiguration supplied to this instance of HttpClient
the response (for all outcomes including 4xx and 5xx status codes) if no exception occurred
(or ConnectException subclass) if an IO exception occurred
Make an OPTIONS request with cookies.
Make an OPTIONS request with cookies.
Make an OPTIONS request.
Make an OPTIONS request. No cookies are used and none are returned.
Make a POST request with cookies.
Make a POST request with cookies.
Make a POST request.
Make a POST request. No cookies are used and none are returned.
Make a PUT request with cookies.
Make a PUT request with cookies.
Make a PUT request.
Make a PUT request. No cookies are used and none are returned.
Make a TRACE request with cookies.
Make a TRACE request with cookies.
Make a TRACE request.
Make a TRACE request. No cookies are used and none are returned.
Provides an alternative to uk.co.bigbeeconsultants.http.HttpClient in which every request carries an outbound cookie jar and every inbound response potentially provides a modified cookie jar. A series of requests will therefore behave like a normal web-browser by aggregating cookies from the server and returning them back in subsequent requests.
Automatic authentication is also supported.
Concurrent requests with an instance of this class are permitted. But when concurrent requests are made, note that there may be race conditions that may or may not cause some cookie updates to be overwritten, depending on the server behaviour. Cookie jars themselves are immutable so will be in either of two states: the original state or the updated state.