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
HTTPRequestcomplex type that appears asRequestin the response syntax.HTTPRequestcontains information about one of the web requests that were returned byGetSampledRequests.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HTTPRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HTTPRequestclone()booleanequals(Object obj)StringgetClientIP()The IP address that the request originated from.StringgetCountry()The two-letter country code for the country that the request originated from.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.StringgetHTTPVersion()The HTTP version specified in the sampled web request, for example,HTTP/1.1.StringgetMethod()The HTTP method specified in the sampled web request.StringgetURI()The part of a web request that identifies the resource, for example,/images/daily-ad.jpg.inthashCode()voidsetClientIP(String clientIP)The IP address that the request originated from.voidsetCountry(String country)The two-letter country code for the country that the request originated from.voidsetHeaders(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.voidsetHTTPVersion(String hTTPVersion)The HTTP version specified in the sampled web request, for example,HTTP/1.1.voidsetMethod(String method)The HTTP method specified in the sampled web request.voidsetURI(String uRI)The part of a web request that identifies the resource, for example,/images/daily-ad.jpg.StringtoString()Returns a string representation of this object; useful for testing and debugging.HTTPRequestwithClientIP(String clientIP)The IP address that the request originated from.HTTPRequestwithCountry(String country)The two-letter country code for the country that the request originated from.HTTPRequestwithHeaders(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.HTTPRequestwithHeaders(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.HTTPRequestwithHTTPVersion(String hTTPVersion)The HTTP version specified in the sampled web request, for example,HTTP/1.1.HTTPRequestwithMethod(String method)The HTTP method specified in the sampled web request.HTTPRequestwithURI(String uRI)The part of a web request that identifies the resource, for example,/images/daily-ad.jpg.
-
-
-
Method Detail
-
setClientIP
public void setClientIP(String clientIP)
The IP address that the request originated from. If the
WebACLis 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 requestx-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 theWebACLis 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 requestx-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
WebACLis 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 requestx-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
WebACLis 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 requestx-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
WebACLis 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 requestx-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 theWebACLis 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 requestx-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, andPUT.- Parameters:
method- The HTTP method specified in the sampled web request. CloudFront supports the following methods:DELETE,GET,HEAD,OPTIONS,PATCH,POST, andPUT.
-
getMethod
public String getMethod()
The HTTP method specified in the sampled web request. CloudFront supports the following methods:
DELETE,GET,HEAD,OPTIONS,PATCH,POST, andPUT.- Returns:
- The HTTP method specified in the sampled web request. CloudFront
supports the following methods:
DELETE,GET,HEAD,OPTIONS,PATCH,POST, andPUT.
-
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, andPUT.- Parameters:
method- The HTTP method specified in the sampled web request. CloudFront supports the following methods:DELETE,GET,HEAD,OPTIONS,PATCH,POST, andPUT.- 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)orwithHeaders(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:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public HTTPRequest clone()
-
-