Class HttpResponseWrapper

java.lang.Object
org.apache.hc.core5.http.message.AbstractMessageWrapper<HttpResponse>
org.apache.hc.core5.http.message.HttpResponseWrapper
All Implemented Interfaces:
HttpMessage, HttpResponse, MessageHeaders

public class HttpResponseWrapper extends AbstractMessageWrapper<HttpResponse> implements HttpResponse
Wraps an HttpResponse. HttpResponse wrapper.
  • Constructor Details

    • HttpResponseWrapper

      public HttpResponseWrapper(HttpResponse message)
  • Method Details

    • getCode

      public int getCode()
      Description copied from interface: HttpResponse
      Obtains the code of this response message.
      Specified by:
      getCode in interface HttpResponse
      Returns:
      the status code.
    • setCode

      public void setCode(int code)
      Description copied from interface: HttpResponse
      Updates status code of this response message.
      Specified by:
      setCode in interface HttpResponse
      Parameters:
      code - the HTTP status code.
      See Also:
    • getReasonPhrase

      public String getReasonPhrase()
      Description copied from interface: HttpResponse
      Obtains the reason phrase of this response if available.
      Specified by:
      getReasonPhrase in interface HttpResponse
      Returns:
      the reason phrase.
    • setReasonPhrase

      public void setReasonPhrase(String reason)
      Description copied from interface: HttpResponse
      Updates the status line of this response with a new reason phrase.
      Specified by:
      setReasonPhrase in interface HttpResponse
      Parameters:
      reason - the new reason phrase as a single-line string, or null to unset the reason phrase
    • getLocale

      public Locale getLocale()
      Description copied from interface: HttpResponse
      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.
      Specified by:
      getLocale in interface HttpResponse
      Returns:
      the locale of this response, never null
    • setLocale

      public void setLocale(Locale loc)
      Description copied from interface: HttpResponse
      Changes the locale of this response.
      Specified by:
      setLocale in interface HttpResponse
      Parameters:
      loc - the new locale