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 asRequest
in the response syntax.HTTPRequest
contains 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 HTTPRequest
clone()
boolean
equals(Object obj)
String
getClientIP()
The IP address that the request originated from.String
getCountry()
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.String
getHTTPVersion()
The HTTP version specified in the sampled web request, for example,HTTP/1.1
.String
getMethod()
The HTTP method specified in the sampled web request.String
getURI()
The part of a web request that identifies the resource, for example,/images/daily-ad.jpg
.int
hashCode()
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
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.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
setURI(String uRI)
The part of a web request that identifies the resource, for example,/images/daily-ad.jpg
.String
toString()
Returns a string representation of this object; useful for testing and debugging.HTTPRequest
withClientIP(String clientIP)
The IP address that the request originated from.HTTPRequest
withCountry(String country)
The two-letter country code for the country that the request originated from.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.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.HTTPRequest
withHTTPVersion(String hTTPVersion)
The HTTP version specified in the sampled web request, for example,HTTP/1.1
.HTTPRequest
withMethod(String method)
The HTTP method specified in the sampled web request.HTTPRequest
withURI(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
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 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 theWebACL
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 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
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 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
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 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
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 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 theWebACL
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 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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public HTTPRequest clone()
-
-