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 Details

    • 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:
    • getReasonPhrase

      String getReasonPhrase()
      Obtains the reason phrase of this response if available.
      Returns:
      the reason phrase.
    • setReasonPhrase

      void setReasonPhrase(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, or null to unset the reason phrase
    • getLocale

      Locale getLocale()
      Obtains the locale of this response. The locale is used to determine the reason phrase for the status code. It can be changed using setLocale.
      Returns:
      the locale of this response, never null
    • setLocale

      void setLocale(Locale loc)
      Changes the locale of this response.
      Parameters:
      loc - the new locale