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 TypeMethodDescriptionvoidclose()Obtains the message entity, if available.voidsetEntity(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, toStringMethods 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, setHeadersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hc.core5.http.HttpMessage
addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersionMethods inherited from interface org.apache.hc.core5.http.HttpResponse
getCode, getLocale, getReasonPhrase, setCode, setLocale, setReasonPhraseMethods 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, ornullto disable automatic reason phrase lookuplocale- the locale for looking up reason phrases, ornullfor 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:HttpEntityContainerObtains the message entity, if available.- Specified by:
getEntityin interfaceHttpEntityContainer- Returns:
- the message entity, or
nullif not available
-
setEntity
Description copied from interface:HttpEntityContainerSets 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:
setEntityin interfaceHttpEntityContainer- Parameters:
entity- the entity to set of this message, ornullto unset
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-