public class HTTPRequest
extends java.lang.Object
implements java.io.Serializable, java.lang.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
.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
clientIP
The IP address that the request originated from.
|
private java.lang.String |
country
The two-letter country code for the country that the request originated
from.
|
private java.util.List<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.
|
private java.lang.String |
hTTPVersion
The HTTP version specified in the sampled web request, for example,
HTTP/1.1 . |
private java.lang.String |
method
The HTTP method specified in the sampled web request.
|
private java.lang.String |
uRI
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg . |
Constructor and Description |
---|
HTTPRequest() |
Modifier and Type | Method and Description |
---|---|
HTTPRequest |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getClientIP()
The IP address that the request originated from.
|
java.lang.String |
getCountry()
The two-letter country code for the country that the request originated
from.
|
java.util.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.
|
java.lang.String |
getHTTPVersion()
The HTTP version specified in the sampled web request, for example,
HTTP/1.1 . |
java.lang.String |
getMethod()
The HTTP method specified in the sampled web request.
|
java.lang.String |
getURI()
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg . |
int |
hashCode() |
void |
setClientIP(java.lang.String clientIP)
The IP address that the request originated from.
|
void |
setCountry(java.lang.String country)
The two-letter country code for the country that the request originated
from.
|
void |
setHeaders(java.util.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(java.lang.String hTTPVersion)
The HTTP version specified in the sampled web request, for example,
HTTP/1.1 . |
void |
setMethod(java.lang.String method)
The HTTP method specified in the sampled web request.
|
void |
setURI(java.lang.String uRI)
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg . |
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
HTTPRequest |
withClientIP(java.lang.String clientIP)
The IP address that the request originated from.
|
HTTPRequest |
withCountry(java.lang.String country)
The two-letter country code for the country that the request originated
from.
|
HTTPRequest |
withHeaders(java.util.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 |
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 |
withHTTPVersion(java.lang.String hTTPVersion)
The HTTP version specified in the sampled web request, for example,
HTTP/1.1 . |
HTTPRequest |
withMethod(java.lang.String method)
The HTTP method specified in the sampled web request.
|
HTTPRequest |
withURI(java.lang.String uRI)
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg . |
private java.lang.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 requestprivate java.lang.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.
private java.lang.String uRI
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg
.
private java.lang.String method
The HTTP method specified in the sampled web request. CloudFront supports
the following methods: DELETE
, GET
,
HEAD
, OPTIONS
, PATCH
,
POST
, and PUT
.
private java.lang.String hTTPVersion
The HTTP version specified in the sampled web request, for example,
HTTP/1.1
.
private java.util.List<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.
public void setClientIP(java.lang.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 requestclientIP
- 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 requestpublic java.lang.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 requestWebACL
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 requestpublic HTTPRequest withClientIP(java.lang.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 requestclientIP
- 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 requestpublic void setCountry(java.lang.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.
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.public java.lang.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.
public HTTPRequest withCountry(java.lang.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.
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.public void setURI(java.lang.String uRI)
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg
.
uRI
- The part of a web request that identifies the resource, for
example, /images/daily-ad.jpg
.public java.lang.String getURI()
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg
.
/images/daily-ad.jpg
.public HTTPRequest withURI(java.lang.String uRI)
The part of a web request that identifies the resource, for example,
/images/daily-ad.jpg
.
uRI
- The part of a web request that identifies the resource, for
example, /images/daily-ad.jpg
.public void setMethod(java.lang.String method)
The HTTP method specified in the sampled web request. CloudFront supports
the following methods: DELETE
, GET
,
HEAD
, OPTIONS
, PATCH
,
POST
, and PUT
.
method
- The HTTP method specified in the sampled web request. CloudFront
supports the following methods: DELETE
,
GET
, HEAD
, OPTIONS
,
PATCH
, POST
, and PUT
.public java.lang.String getMethod()
The HTTP method specified in the sampled web request. CloudFront supports
the following methods: DELETE
, GET
,
HEAD
, OPTIONS
, PATCH
,
POST
, and PUT
.
DELETE
,
GET
, HEAD
, OPTIONS
,
PATCH
, POST
, and PUT
.public HTTPRequest withMethod(java.lang.String method)
The HTTP method specified in the sampled web request. CloudFront supports
the following methods: DELETE
, GET
,
HEAD
, OPTIONS
, PATCH
,
POST
, and PUT
.
method
- The HTTP method specified in the sampled web request. CloudFront
supports the following methods: DELETE
,
GET
, HEAD
, OPTIONS
,
PATCH
, POST
, and PUT
.public void setHTTPVersion(java.lang.String hTTPVersion)
The HTTP version specified in the sampled web request, for example,
HTTP/1.1
.
hTTPVersion
- The HTTP version specified in the sampled web request, for
example, HTTP/1.1
.public java.lang.String getHTTPVersion()
The HTTP version specified in the sampled web request, for example,
HTTP/1.1
.
HTTP/1.1
.public HTTPRequest withHTTPVersion(java.lang.String hTTPVersion)
The HTTP version specified in the sampled web request, for example,
HTTP/1.1
.
hTTPVersion
- The HTTP version specified in the sampled web request, for
example, HTTP/1.1
.public java.util.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.
public void setHeaders(java.util.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.
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.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.
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.public HTTPRequest withHeaders(java.util.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.
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.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public HTTPRequest clone()
clone
in class java.lang.Object