Interface HttpResponse

All Known Implementing Classes:
ServletHttpResponse

public interface HttpResponse
Represents an outgoing HTTP response and the contract to manipulate it.
Author:
Pedro Igor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendError(int statusCode)
    Send an error with the given statusCode.
    void
    sendError(int statusCode, String reason)
    Send an error with the given statusCode and reason message.
    void
    setHeader(String name, String value)
    Set a header with the given name and value.
  • Method Details

    • sendError

      void sendError(int statusCode)
      Send an error with the given statusCode.
      Parameters:
      statusCode - the status to set in the response
    • sendError

      void sendError(int statusCode, String reason)
      Send an error with the given statusCode and reason message.
      Parameters:
      statusCode - the status to set in the response
    • setHeader

      void setHeader(String name, String value)
      Set a header with the given name and value.
      Parameters:
      name - the header name
      value - the header value