Class HttpResponseImpl

java.lang.Object
net.uiqui.embedhttp.api.impl.HttpResponseImpl
All Implemented Interfaces:
HttpResponse

public class HttpResponseImpl extends Object implements HttpResponse
  • Constructor Details

    • HttpResponseImpl

      public HttpResponseImpl(HttpStatusCode statusCode)
    • HttpResponseImpl

      public HttpResponseImpl(int statusCode, String statusMessage)
  • Method Details

    • setHeader

      public HttpResponse setHeader(HttpHeader name, String value)
      Description copied from interface: HttpResponse
      Sets a header for the response.
      Specified by:
      setHeader in interface HttpResponse
      Parameters:
      name - the header name as an enum
      value - the header value
    • setHeader

      public HttpResponse setHeader(String name, String value)
      Description copied from interface: HttpResponse
      Sets a header for the response.
      Specified by:
      setHeader in interface HttpResponse
      Parameters:
      name - the header name as a string
      value - the header value
    • setBody

      public HttpResponse setBody(ContentType contentType, String body)
      Description copied from interface: HttpResponse
      Sets the body of the response with a specific content type.
      Specified by:
      setBody in interface HttpResponse
      Parameters:
      contentType - the content type
      body - the body as a string
    • setBody

      public HttpResponse setBody(String contentType, String body)
      Description copied from interface: HttpResponse
      Sets the body of the response with a specific content type.
      Specified by:
      setBody in interface HttpResponse
      Parameters:
      contentType - the content type as a string
      body - the body as a string
    • getStatusCode

      public int getStatusCode()
    • getStatusMessage

      public String getStatusMessage()
    • getHeaders

      public Map<String,String> getHeaders()
    • getBody

      public String getBody()