Class ContentResponseHandler
- java.lang.Object
-
- org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<Content>
-
- org.apache.hc.client5.http.fluent.ContentResponseHandler
-
-
Constructor Summary
Constructors Constructor Description ContentResponseHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContenthandleEntity(org.apache.hc.core5.http.HttpEntity entity)ContenthandleResponse(org.apache.hc.core5.http.ClassicHttpResponse response)Handles a successful response (2xx status code) and returns the response entity as aContentobject.
-
-
-
Method Detail
-
handleEntity
public Content handleEntity(org.apache.hc.core5.http.HttpEntity entity) throws java.io.IOException
- Specified by:
handleEntityin classorg.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<Content>- Throws:
java.io.IOException
-
handleResponse
public Content handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws java.io.IOException
Handles a successful response (2xx status code) and returns the response entity as aContentobject. If no response entity exists,Content.NO_CONTENTis returned.- Specified by:
handleResponsein interfaceorg.apache.hc.core5.http.io.HttpClientResponseHandler<Content>- Overrides:
handleResponsein classorg.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler<Content>- Parameters:
response- the HTTP response.- Returns:
- a
Contentobject that encapsulates the response body, orContent.NO_CONTENTif the response body isnullor has zero length. - Throws:
org.apache.hc.client5.http.HttpResponseException- if the response was unsuccessful (status code greater than 300).java.io.IOException- if an I/O error occurs.
-
-