Package org.apache.hc.core5.http.message
Class BasicClassicHttpResponse
java.lang.Object
org.apache.hc.core5.http.message.HeaderGroup
org.apache.hc.core5.http.message.BasicHttpResponse
org.apache.hc.core5.http.message.BasicClassicHttpResponse
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,ClassicHttpResponse
,HttpEntityContainer
,HttpMessage
,HttpResponse
,MessageHeaders
Basic implementation of
ClassicHttpResponse
.- Since:
- 5.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasicClassicHttpResponse
(int code) Creates a new response.BasicClassicHttpResponse
(int code, String reasonPhrase) Creates a new response.BasicClassicHttpResponse
(int code, ReasonPhraseCatalog catalog, Locale locale) Creates a new response. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Obtains the message entity, if available.void
setEntity
(HttpEntity entity) Sets an entity for this message.Methods inherited from class org.apache.hc.core5.http.message.BasicHttpResponse
addHeader, getCode, getLocale, getReason, getReasonPhrase, getVersion, setCode, setHeader, setLocale, setReasonPhrase, setVersion, toString
Methods inherited from class org.apache.hc.core5.http.message.HeaderGroup
addHeader, clear, containsHeader, countHeaders, getCondensedHeader, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, removeHeaders, setHeader, setHeaders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hc.core5.http.HttpMessage
addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion
Methods inherited from interface org.apache.hc.core5.http.HttpResponse
getCode, getLocale, getReasonPhrase, setCode, setLocale, setReasonPhrase
Methods inherited from interface org.apache.hc.core5.http.MessageHeaders
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
entity
-
-
Constructor Details
-
BasicClassicHttpResponse
Creates a new response.- Parameters:
code
- the status codecatalog
- the reason phrase catalog, ornull
to disable automatic reason phrase lookuplocale
- the locale for looking up reason phrases, ornull
for the system locale
-
BasicClassicHttpResponse
Creates a new response.- Parameters:
code
- the status code of the responsereasonPhrase
- the reason phrase to the status code, ornull
-
BasicClassicHttpResponse
public BasicClassicHttpResponse(int code) Creates a new response.- Parameters:
code
- the status code of the response
-
-
Method Details
-
getEntity
Description copied from interface:HttpEntityContainer
Obtains the message entity, if available.- Specified by:
getEntity
in interfaceHttpEntityContainer
- Returns:
- the message entity, or
null
if not available
-
setEntity
Description copied from interface:HttpEntityContainer
Sets an entity for this message.Please note that if an entity has already been set it is responsibility of the caller to ensure release of the resources that may be associated with that entity.
- Specified by:
setEntity
in interfaceHttpEntityContainer
- Parameters:
entity
- the entity to set of this message, ornull
to unset
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-