Package org.apache.hc.core5.http
Interface HttpResponse
-
- All Superinterfaces:
HttpMessage,MessageHeaders
- All Known Subinterfaces:
ClassicHttpResponse
- All Known Implementing Classes:
BasicClassicHttpResponse,BasicHttpResponse,HttpResponseWrapper
public interface HttpResponse extends HttpMessage
After receiving and interpreting a request message, a server responds with an HTTP response message.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCode()Obtains the code of this response message.java.util.LocalegetLocale()Obtains the locale of this response.java.lang.StringgetReasonPhrase()Obtains the reason phrase of this response if available.voidsetCode(int code)Updates status code of this response message.voidsetLocale(java.util.Locale loc)Changes the locale of this response.voidsetReasonPhrase(java.lang.String reason)Updates the status line of this response with a new reason phrase.-
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.MessageHeaders
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
-
-
-
-
Method Detail
-
getCode
int getCode()
Obtains the code of this response message.- Returns:
- the status code.
-
setCode
void setCode(int code)
Updates status code of this response message.- Parameters:
code- the HTTP status code.- See Also:
HttpStatus
-
getReasonPhrase
java.lang.String getReasonPhrase()
Obtains the reason phrase of this response if available.- Returns:
- the reason phrase.
-
setReasonPhrase
void setReasonPhrase(java.lang.String reason)
Updates the status line of this response with a new reason phrase.- Parameters:
reason- the new reason phrase as a single-line string, ornullto unset the reason phrase
-
getLocale
java.util.Locale getLocale()
Obtains the locale of this response. The locale is used to determine the reason phrase for thestatus code. It can be changed usingsetLocale.- Returns:
- the locale of this response, never
null
-
setLocale
void setLocale(java.util.Locale loc)
Changes the locale of this response.- Parameters:
loc- the new locale
-
-