Interface GenHttpRequest


  • public interface GenHttpRequest
    Defines the interface of an HTTP request.
    • Method Detail

      • execute

        GenHttpResponse execute()
                         throws java.io.IOException
        Executes the request and delivers the response.
        Returns:
        a new instance of GenHttpResponse
        Throws:
        java.io.IOException - when the request failed
      • setUri

        GenHttpRequest setUri​(java.net.URI uri)
        Sets the request URI.
        Parameters:
        uri - the URI
        Returns:
        the same instance of GenHttpRequest
      • setHttpMethod

        void setHttpMethod​(HttpMethod httpMethod)
        Sets the HTTP method.
        Parameters:
        httpMethod - the HTTP method
      • addHeader

        void addHeader​(java.lang.String key,
                       java.lang.String value)
        Adds a request header.
        Parameters:
        key - the header name
        value - the header value
      • setBody

        void setBody​(java.lang.String body)
        Sets the request body.
        Parameters:
        body - the request body as string
      • addFormParam

        void addFormParam​(java.lang.String key,
                          java.lang.String value)
        Adds a form parameter to the request.
        Parameters:
        key - the parameter name
        value - the parameter value