Top Description Fields Constructors Methods
org.apache.hc.client5.http.protocol

public Class ResponseProcessCookies

extends Object
implements HttpResponseInterceptor
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.HttpResponseInterceptor
Annotations
@Contract
threading:STATELESS
Imports
java.io.IOException, java.util.Iterator, .List, org.apache.hc.client5.http.cookie.Cookie, .CookieOrigin, .CookieSpec, .CookieStore, .MalformedCookieException, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.EntityDetails, .Header, .HttpException, .HttpHeaders, .HttpResponse, .HttpResponseInterceptor, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.util.Args, org.slf4j.Logger, .LoggerFactory

Response interceptor that populates the current CookieStore with data contained in response cookies received in the given the HTTP response.
Since
4.0

Field Summary

Modifier and TypeField and Description
public static final ResponseProcessCookies
INSTANCE

Singleton instance.

private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String
formatCookie(final Cookie cookie)

public void
process(final HttpResponse
the response to process
response
,
final EntityDetails
the request entity details or null if not available
entity
,
final HttpContext
the context for the request
context
)

Implements org.apache.hc.core5.http.HttpResponseInterceptor.process.

Processes a response.
private void
processCookies(final String exchangeId, final Iterator<Header> iterator, final CookieSpec cookieSpec, final CookieOrigin cookieOrigin, final CookieStore cookieStore)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final ResponseProcessCookies INSTANCE

Singleton instance.

Since
5.2
LOGback to summary
private static final Logger LOG

Constructor Detail

ResponseProcessCookiesback to summary
public ResponseProcessCookies()

Method Detail

formatCookieback to summary
private static String formatCookie(final Cookie cookie)
processback to summary
public void process(final HttpResponse response, final EntityDetails entity, final HttpContext context) throws HttpException, IOException

Implements org.apache.hc.core5.http.HttpResponseInterceptor.process.

Doc from org.apache.hc.core5.http.HttpResponseInterceptor.process.

Processes a response. On the server side, this step is performed before the response is sent to the client. On the client side, this step is performed on incoming messages before the message body is evaluated.

Parameters
response:HttpResponse

the response to process

entity:EntityDetails

the request entity details or null if not available

context:HttpContext

the context for the request

Annotations
@Override
Exceptions
HttpException:
in case of an HTTP protocol violation
IOException:
in case of an I/O error
processCookiesback to summary
private void processCookies(final String exchangeId, final Iterator<Header> iterator, final CookieSpec cookieSpec, final CookieOrigin cookieOrigin, final CookieStore cookieStore)