Class HttpRequest

java.lang.Object
com.moesif.api.http.request.HttpRequest
Direct Known Subclasses:
HttpBodyRequest

public class HttpRequest extends Object
  • Constructor Details

    • HttpRequest

      public HttpRequest(HttpMethod _method, String _queryUrl, Map<String,String> _headers, Map<String,Object> _parameters)
      Initializes a simple http request
      Parameters:
      _method - The HTTP method to use. Can be GET, HEAD, PUT, POST, DELETE and PATCH
      _queryUrl - The http url to create the HTTP Request. Expect a fully qualified absolute Url
      _headers - The key-value map of all http headers to be sent
      _parameters - The form data values in a key-value map
    • HttpRequest

      public HttpRequest(HttpMethod _method, String _queryUrl, Map<String,String> _headers, Map<String,Object> _parameters, String _username, String _password)
      Initializes a simple http request
      Parameters:
      _method - The HTTP method to use. Can be GET, HEAD, PUT, POST, DELETE and PATCH
      _queryUrl - The http url to create the HTTP Request. Expect a fully qualified absolute Url
      _headers - The key-value map of all http headers to be sent
      _parameters - The form data values in a key-value map
      _username - Username for basic authentication
      _password - Password for basic authentication
  • Method Details

    • getHttpMethod

      public HttpMethod getHttpMethod()
      Headers for the http request
      Returns:
      the HTTP method/verb
    • getHeaders

      public Map<String,String> getHeaders()
      Headers for the http request
      Returns:
      the HTTP request headers
    • getQueryUrl

      public String getQueryUrl()
      Query url for the http request
      Returns:
      the query url
    • getParameters

      public Map<String,Object> getParameters()
      Parameters for the http request
      Returns:
      the parameters as a map
    • getUsername

      public String getUsername()
      Username for basic authentication
      Returns:
      the username part for basic auth
    • getPassword

      public String getPassword()
      Password for basic authentication
      Returns:
      the password part for basic auth