public class ContentResponseHandler extends AbstractHttpClientResponseHandler<Content>
Content
Constructor and Description |
---|
ContentResponseHandler() |
Modifier and Type | Method and Description |
---|---|
Content |
handleEntity(org.apache.hc.core5.http.HttpEntity entity) |
Content |
handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response)
Handles a successful response (2xx status code) and returns the response entity as a
Content object. |
public Content handleEntity(org.apache.hc.core5.http.HttpEntity entity) throws IOException
handleEntity
in class AbstractHttpClientResponseHandler<Content>
IOException
public Content handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException
Content
object.
If no response entity exists, Content.NO_CONTENT
is returned.handleResponse
in interface org.apache.hc.core5.http.io.HttpClientResponseHandler<Content>
handleResponse
in class AbstractHttpClientResponseHandler<Content>
response
- the HTTP response.Content
object that encapsulates the response body, or Content.NO_CONTENT
if the
response body is null
or has zero length.HttpResponseException
- if the response was unsuccessful (status code greater than 300).IOException
- if an I/O error occurs.Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.