Class HTTPRequest
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionclone()
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.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
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
.toString()
Returns a string representation of this object; useful for testing and debugging.withClientIP
(String clientIP) The IP address that the request originated from.withCountry
(String country) 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.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.withHTTPVersion
(String hTTPVersion) The HTTP version specified in the sampled web request, for example,HTTP/1.1
.withMethod
(String method) 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
.
-
Constructor Details
-
HTTPRequest
public HTTPRequest()
-
-
Method Details
-
setClientIP
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-