public final class HttpRequest extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpRequest.Builder
A builder for
HttpRequest objects. |
static class |
HttpRequest.RequestMethod
The HTTP request method.
|
| Modifier and Type | Method and Description |
|---|---|
static HttpRequest.Builder |
builder()
Returns a builder for
HttpRequest objects. |
boolean |
cacheHit()
Returns whether or not an entity was served from cache (with or without validation).
|
boolean |
cacheValidatedWithOriginServer()
Returns whether or not the response was validated with the origin server before being served
from cache.
|
boolean |
equals(Object obj) |
int |
hashCode()
Returns the number of HTTP response bytes inserted into cache.
|
String |
referer()
Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.
|
String |
remoteIp()
Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request.
|
HttpRequest.RequestMethod |
requestMethod()
Returns the HTTP request method.
|
Long |
requestSize()
Returns the size of the HTTP request message in bytes, including the request headers and the
request body.
|
String |
requestUrl()
Returns the requested URL.
|
Long |
responseSize()
Returns the size of the HTTP response message sent back to the client, in bytes, including the
response headers and the response body.
|
Integer |
status()
Returns the response code indicating the status of response.
|
HttpRequest.Builder |
toBuilder()
Returns a builder for this object.
|
String |
toString() |
String |
userAgent()
Returns the user agent sent by the client.
|
public HttpRequest.RequestMethod requestMethod()
public String requestUrl()
http, https), the
host name, the path and the query portion of the URL that was requested. Example:
http://example.com/some/info?color=red.public Long requestSize()
public Integer status()
public Long responseSize()
public String userAgent()
Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705).public String remoteIp()
192.168.1.1, FE80::0202:B3FF:FE1E:8329.public String referer()
public boolean cacheHit()
false.public boolean cacheValidatedWithOriginServer()
false. This field is only meaningful if
cacheHit() is set to true.public int hashCode()
public HttpRequest.Builder toBuilder()
public static HttpRequest.Builder builder()
HttpRequest objects.Copyright © 2016 Google. All rights reserved.