public class BasicClassicHttpResponse extends BasicHttpResponse implements ClassicHttpResponse
ClassicHttpResponse
.Constructor and Description |
---|
BasicClassicHttpResponse(int code)
Creates a new response.
|
BasicClassicHttpResponse(int code,
ReasonPhraseCatalog catalog,
Locale locale)
Creates a new response.
|
BasicClassicHttpResponse(int code,
String reasonPhrase)
Creates a new response.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
HttpEntity |
getEntity()
Obtains the message entity, if available.
|
void |
setEntity(HttpEntity entity)
Sets an entity for this message.
|
addHeader, getCode, getLocale, getReason, getReasonPhrase, getVersion, setCode, setHeader, setLocale, setReasonPhrase, setVersion, toString
addHeader, clear, containsHeader, countHeaders, getCondensedHeader, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, removeHeaders, setHeader, setHeaders
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCode, getLocale, getReasonPhrase, setCode, setLocale, setReasonPhrase
addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
public BasicClassicHttpResponse(int code, ReasonPhraseCatalog catalog, Locale locale)
code
- the status codecatalog
- the reason phrase catalog, or
null
to disable automatic
reason phrase lookuplocale
- the locale for looking up reason phrases, or
null
for the system localepublic BasicClassicHttpResponse(int code, String reasonPhrase)
code
- the status code of the responsereasonPhrase
- the reason phrase to the status code, or null
public BasicClassicHttpResponse(int code)
code
- the status code of the responsepublic HttpEntity getEntity()
HttpEntityContainer
getEntity
in interface HttpEntityContainer
null
if not availablepublic void setEntity(HttpEntity entity)
HttpEntityContainer
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.
setEntity
in interface HttpEntityContainer
entity
- the entity to set of this message, or null
to unsetpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.