Class HTTPRequest

    • Constructor Detail

      • HTTPRequest

        public HTTPRequest()
    • Method Detail

      • setClientIP

        public void setClientIP​(String clientIP)

        The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

        • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
        • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
        Parameters:
        clientIP - The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

        • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
        • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
      • getClientIP

        public String getClientIP()

        The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

        • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
        • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
        Returns:
        The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

        • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
        • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
      • withClientIP

        public HTTPRequest withClientIP​(String clientIP)

        The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

        • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
        • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
        Parameters:
        clientIP - The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

        • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
        • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setCountry

        public void setCountry​(String country)

        The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.

        Parameters:
        country - The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.
      • getCountry

        public String getCountry()

        The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.

        Returns:
        The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.
      • withCountry

        public HTTPRequest withCountry​(String country)

        The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.

        Parameters:
        country - The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setURI

        public void setURI​(String uRI)

        The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.

        Parameters:
        uRI - The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.
      • getURI

        public String getURI()

        The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.

        Returns:
        The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.
      • withURI

        public HTTPRequest withURI​(String uRI)

        The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.

        Parameters:
        uRI - The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setMethod

        public void setMethod​(String method)

        The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.

        Parameters:
        method - The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.
      • getMethod

        public String getMethod()

        The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.

        Returns:
        The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.
      • withMethod

        public HTTPRequest withMethod​(String method)

        The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.

        Parameters:
        method - The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setHTTPVersion

        public void setHTTPVersion​(String hTTPVersion)

        The HTTP version specified in the sampled web request, for example, HTTP/1.1.

        Parameters:
        hTTPVersion - The HTTP version specified in the sampled web request, for example, HTTP/1.1.
      • getHTTPVersion

        public String getHTTPVersion()

        The HTTP version specified in the sampled web request, for example, HTTP/1.1.

        Returns:
        The HTTP version specified in the sampled web request, for example, HTTP/1.1.
      • withHTTPVersion

        public HTTPRequest withHTTPVersion​(String hTTPVersion)

        The HTTP version specified in the sampled web request, for example, HTTP/1.1.

        Parameters:
        hTTPVersion - The HTTP version specified in the sampled web request, for example, HTTP/1.1.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • getHeaders

        public List<HTTPHeader> getHeaders()

        A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.

        Returns:
        A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.
      • setHeaders

        public void setHeaders​(Collection<HTTPHeader> headers)

        A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.

        Parameters:
        headers - A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.
      • withHeaders

        public HTTPRequest withHeaders​(HTTPHeader... headers)

        A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.

        NOTE: This method appends the values to the existing list (if any). Use setHeaders(java.util.Collection) or withHeaders(java.util.Collection) if you want to override the existing values.

        Parameters:
        headers - A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • withHeaders

        public HTTPRequest withHeaders​(Collection<HTTPHeader> headers)

        A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.

        Parameters:
        headers - A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • toString

        public String toString()
        Returns a string representation of this object; useful for testing and debugging.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this object.
        See Also:
        Object.toString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object