Class HTTPRequest

java.lang.Object
com.amazonaws.services.waf.model.HTTPRequest
All Implemented Interfaces:
Serializable, Cloneable

public class HTTPRequest extends Object implements Serializable, Cloneable

The response from a GetSampledRequests request includes an HTTPRequest complex type that appears as Request in the response syntax. HTTPRequest contains information about one of the web requests that were returned by GetSampledRequests.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    The IP address that the request originated from.
    The two-letter country code for the country that the request originated from.
    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.
    The HTTP version specified in the sampled web request, for example, HTTP/1.1.
    The HTTP method specified in the sampled web request.
    The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.
    int
     
    void
    setClientIP(String clientIP)
    The IP address that the request originated from.
    void
    setCountry(String country)
    The two-letter country code for the country that the request originated from.
    void
    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.
    void
    setHTTPVersion(String hTTPVersion)
    The HTTP version specified in the sampled web request, for example, HTTP/1.1.
    void
    setMethod(String method)
    The HTTP method specified in the sampled web request.
    void
    The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.
    Returns a string representation of this object; useful for testing and debugging.
    withClientIP(String clientIP)
    The IP address that the request originated from.
    The two-letter country code for the country that the request originated from.
    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.
    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.
    withHTTPVersion(String hTTPVersion)
    The HTTP version specified in the sampled web request, for example, HTTP/1.1.
    The HTTP method specified in the sampled web request.
    The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HTTPRequest

      public HTTPRequest()
  • Method Details

    • 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:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public HTTPRequest clone()
      Overrides:
      clone in class Object