Class Request

java.lang.Object
tech.xigam.express.Request

public final class Request extends Object
This is a class that contains related data of an HTTP request.
  • Field Details

    • httpExchange

      public final HttpExchange httpExchange
    • requestType

      public final String requestType
    • requestUrl

      public final String requestUrl
    • requestBody

      public final String requestBody
    • requestArguments

      public final Map<String,String> requestArguments
  • Constructor Details

  • Method Details

    • code

      public Request code(int statusCode)
    • addHeader

      public Request addHeader(String name, String... value)
    • respond

      public void respond(String response)
    • urlSegments

      public List<String> urlSegments()
      Fetch the URL segments.
      Returns:
      The segments (without the https://) of the request URL.
    • getArgument

      public String getArgument(String key)
      Returns the request argument with the given name.
      Parameters:
      key - The name of the argument.
      Returns:
      The value of the argument.
    • getRequestBody

      public String getRequestBody()
      Returns the request's body data.
      Returns:
      The request body as a string.