Package 

Class Request

    • Constructor Summary

      Constructors 
      Constructor Description
      Request(String httpVersion, String httpMethod, String url) Constructs a new Request with the specified HTTP version, method, and URL.If the URL contains query parameters, they will be extracted and stored separately.
      Request(String httpMethod, String url) Constructs a new Request with the specified HTTP method and URL.The HTTP version will be set to null.If the URL contains query parameters, they will be extracted and stored separately.
    • Constructor Detail

      • Request

        Request(String httpVersion, String httpMethod, String url)
        Constructs a new Request with the specified HTTP version, method, and URL.If the URL contains query parameters, they will be extracted and stored separately.
        Parameters:
        httpVersion - the HTTP version (e.g.
        httpMethod - the HTTP method (e.g.
        url - the request URL, optionally including query parameters, or null
      • Request

        Request(String httpMethod, String url)
        Constructs a new Request with the specified HTTP method and URL.The HTTP version will be set to null.If the URL contains query parameters, they will be extracted and stored separately.
        Parameters:
        httpMethod - the HTTP method (e.g.
        url - the request URL, optionally including query parameters, or null
    • Method Detail

      • setHttpMethod

         void setHttpMethod(@Nullable() String httpMethod)

        Set the HTTP method for this request (e.g. "GET", "POST").

        Parameters:
        httpMethod - the HTTP method name
      • setHttpVersion

         void setHttpVersion(@Nullable() String httpVersion)

        Set the HTTP version for this request (e.g. "HTTP/1.1").

        Parameters:
        httpVersion - the HTTP version
      • setUrl

         void setUrl(@Nullable() String url)

        Set the URL for this request. If the URL contains a query string, the query parameterswill be extracted and stored separately, and the URL will be set without the query string.

        Parameters:
        url - the request URL, optionally including query parameters
      • addQueryParameter

         void addQueryParameter(@NonNull() String name, @Nullable() String value)

        Add a query parameter to this reported request.

        Parameters:
        name - the name of the query parameter
        value - the value of the query parameter
      • removeQueryParameter

         void removeQueryParameter(@NonNull() String name)

        Remove the specified query parameter by name (case-sensitive).

        Parameters:
        name - the query parameter to remove
      • getQueryParameter

        @Nullable() String getQueryParameter(@NonNull() String name)

        Return the query parameter value by name or null if the parameter is not present.

        Parameters:
        name - the query parameter name (case-sensitive)