Class CloseableHttpResponse
java.lang.Object
org.apache.hc.client5.http.impl.classic.CloseableHttpResponse
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.hc.core5.http.ClassicHttpResponse
,org.apache.hc.core5.http.HttpEntityContainer
,org.apache.hc.core5.http.HttpMessage
,org.apache.hc.core5.http.HttpResponse
,org.apache.hc.core5.http.MessageHeaders
public final class CloseableHttpResponse
extends Object
implements org.apache.hc.core5.http.ClassicHttpResponse
Provided for backward compatibility with HttpClient 4.x.
- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExecRuntime
private final org.apache.hc.core5.http.ClassicHttpResponse
-
Constructor Summary
ConstructorsConstructorDescriptionCloseableHttpResponse
(org.apache.hc.core5.http.ClassicHttpResponse response, ExecRuntime execRuntime) -
Method Summary
Modifier and TypeMethodDescription(package private) static CloseableHttpResponse
adapt
(org.apache.hc.core5.http.ClassicHttpResponse response) void
void
addHeader
(org.apache.hc.core5.http.Header header) void
close()
boolean
containsHeader
(String name) int
countHeaders
(String name) int
getCode()
org.apache.hc.core5.http.HttpEntity
org.apache.hc.core5.http.Header
getFirstHeader
(String name) org.apache.hc.core5.http.Header
org.apache.hc.core5.http.Header[]
org.apache.hc.core5.http.Header[]
getHeaders
(String name) org.apache.hc.core5.http.Header
getLastHeader
(String name) org.apache.hc.core5.http.ProtocolVersion
Iterator
<org.apache.hc.core5.http.Header> Iterator
<org.apache.hc.core5.http.Header> headerIterator
(String name) boolean
removeHeader
(org.apache.hc.core5.http.Header header) boolean
removeHeaders
(String name) void
setCode
(int code) void
setEntity
(org.apache.hc.core5.http.HttpEntity entity) void
void
setHeader
(org.apache.hc.core5.http.Header header) void
setHeaders
(org.apache.hc.core5.http.Header... headers) void
void
setReasonPhrase
(String reason) void
setVersion
(org.apache.hc.core5.http.ProtocolVersion version) toString()
-
Field Details
-
response
private final org.apache.hc.core5.http.ClassicHttpResponse response -
execRuntime
-
-
Constructor Details
-
CloseableHttpResponse
CloseableHttpResponse(org.apache.hc.core5.http.ClassicHttpResponse response, ExecRuntime execRuntime)
-
-
Method Details
-
adapt
-
getCode
public int getCode()- Specified by:
getCode
in interfaceorg.apache.hc.core5.http.HttpResponse
-
getEntity
public org.apache.hc.core5.http.HttpEntity getEntity()- Specified by:
getEntity
in interfaceorg.apache.hc.core5.http.HttpEntityContainer
-
containsHeader
- Specified by:
containsHeader
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
setVersion
public void setVersion(org.apache.hc.core5.http.ProtocolVersion version) - Specified by:
setVersion
in interfaceorg.apache.hc.core5.http.HttpMessage
-
setCode
public void setCode(int code) - Specified by:
setCode
in interfaceorg.apache.hc.core5.http.HttpResponse
-
getReasonPhrase
- Specified by:
getReasonPhrase
in interfaceorg.apache.hc.core5.http.HttpResponse
-
countHeaders
- Specified by:
countHeaders
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
setEntity
public void setEntity(org.apache.hc.core5.http.HttpEntity entity) - Specified by:
setEntity
in interfaceorg.apache.hc.core5.http.HttpEntityContainer
-
getVersion
public org.apache.hc.core5.http.ProtocolVersion getVersion()- Specified by:
getVersion
in interfaceorg.apache.hc.core5.http.HttpMessage
-
setReasonPhrase
- Specified by:
setReasonPhrase
in interfaceorg.apache.hc.core5.http.HttpResponse
-
getHeaders
- Specified by:
getHeaders
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
addHeader
public void addHeader(org.apache.hc.core5.http.Header header) - Specified by:
addHeader
in interfaceorg.apache.hc.core5.http.HttpMessage
-
getLocale
- Specified by:
getLocale
in interfaceorg.apache.hc.core5.http.HttpResponse
-
addHeader
- Specified by:
addHeader
in interfaceorg.apache.hc.core5.http.HttpMessage
-
setLocale
- Specified by:
setLocale
in interfaceorg.apache.hc.core5.http.HttpResponse
-
getHeader
public org.apache.hc.core5.http.Header getHeader(String name) throws org.apache.hc.core5.http.ProtocolException - Specified by:
getHeader
in interfaceorg.apache.hc.core5.http.MessageHeaders
- Throws:
org.apache.hc.core5.http.ProtocolException
-
setHeader
public void setHeader(org.apache.hc.core5.http.Header header) - Specified by:
setHeader
in interfaceorg.apache.hc.core5.http.HttpMessage
-
getFirstHeader
- Specified by:
getFirstHeader
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
setHeader
- Specified by:
setHeader
in interfaceorg.apache.hc.core5.http.HttpMessage
-
setHeaders
public void setHeaders(org.apache.hc.core5.http.Header... headers) - Specified by:
setHeaders
in interfaceorg.apache.hc.core5.http.HttpMessage
-
removeHeader
public boolean removeHeader(org.apache.hc.core5.http.Header header) - Specified by:
removeHeader
in interfaceorg.apache.hc.core5.http.HttpMessage
-
removeHeaders
- Specified by:
removeHeaders
in interfaceorg.apache.hc.core5.http.HttpMessage
-
getLastHeader
- Specified by:
getLastHeader
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
getHeaders
public org.apache.hc.core5.http.Header[] getHeaders()- Specified by:
getHeaders
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
headerIterator
- Specified by:
headerIterator
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
headerIterator
- Specified by:
headerIterator
in interfaceorg.apache.hc.core5.http.MessageHeaders
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
toString
-