Interface HTTPRequest


public interface HTTPRequest
Details of an HTTP Request from a web server.
Since:
4.0
  • Method Details

    • getMethodName

      String getMethodName()
      Get the method Name.
      Returns:
      the method name
    • getURL

      String getURL()
      Returns the request URL.
      Returns:
      string representation of the URL
    • getPath

      String getPath()
      Returns the path of request URL.
      Returns:
      string representation of the path of the URL
    • getHeader

      String getHeader(String name)
      Get specified header.
      Parameters:
      name - header name
      Returns:
      header value or null if no such header
    • getHeaders

      Map<String,String> getHeaders()
      Get headers.

      Return all of the headers

      Returns:
      a HashMap of the headers contained within the request
      Since:
      4.1
    • getRemoteAddress

      String getRemoteAddress()
      Get the remote address of the HTTP request. If this has been forwarded-for, the forwarded for address will be used
      Returns:
      the remote IP Address
      Since:
      4.1
    • getParameter

      String getParameter(String name)
      Get specified parameter.
      Parameters:
      name - parameter name
      Returns:
      parameter value or null if no such parameter
    • getContent

      byte[] getContent()
      Returns a byte array containing the request content.
      Returns:
      byte array which could be zero length
    • getTimestamp

      long getTimestamp()
      Return the request time.
      Returns:
      the time in measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
    • writeResponse

      void writeResponse(ByteBuffer buffer) throws APIException
      Write a response.

      This will write the contents of the supplied buffer from its position to its limit.

      Parameters:
      buffer - containing the response
      Throws:
      APIException - if unable to write
    • close

      void close()
      Close the request.

      This closes its underlying channel.