public static final class HttpRequest.Builder extends Object
HttpRequest objects.| Modifier and Type | Method and Description |
|---|---|
HttpRequest |
build()
Creates a
HttpRequest object for this builder. |
HttpRequest.Builder |
cacheHit(boolean cacheHit)
Sets whether or not an entity was served from cache (with or without validation).
|
HttpRequest.Builder |
cacheValidatedWithOriginServer(boolean cacheValidatedWithOriginServer)
Sets whether or not the response was validated with the origin server before being served
from cache.
|
HttpRequest.Builder |
referer(String referer)
Sets the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.
|
HttpRequest.Builder |
remoteIp(String remoteIp)
Sets the IP address (IPv4 or IPv6) of the client that issued the HTTP request.
|
HttpRequest.Builder |
requestMethod(HttpRequest.RequestMethod requestMethod)
Sets the HTTP request method.
|
HttpRequest.Builder |
requestSize(long requestSize)
Sets the size of the HTTP request message in bytes, including the request headers and the
request body.
|
HttpRequest.Builder |
requestUrl(String requestUrl)
Sets the requested URL.
|
HttpRequest.Builder |
responseSize(long responseSize)
Sets the size of the HTTP response message sent back to the client, in bytes, including the
response headers and the response body.
|
HttpRequest.Builder |
status(int status)
Sets the response code indicating the status of response.
|
HttpRequest.Builder |
userAgent(String userAgent)
Sets the user agent sent by the client.
|
public HttpRequest.Builder requestMethod(HttpRequest.RequestMethod requestMethod)
public HttpRequest.Builder requestUrl(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 HttpRequest.Builder requestSize(long requestSize)
public HttpRequest.Builder status(int status)
public HttpRequest.Builder responseSize(long responseSize)
public HttpRequest.Builder userAgent(String userAgent)
Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705).public HttpRequest.Builder remoteIp(String remoteIp)
192.168.1.1, FE80::0202:B3FF:FE1E:8329.public HttpRequest.Builder referer(String referer)
public HttpRequest.Builder cacheHit(boolean cacheHit)
false is used.public HttpRequest.Builder cacheValidatedWithOriginServer(boolean cacheValidatedWithOriginServer)
cacheHit(boolean) is set to
true. If not set, false is used.public HttpRequest build()
HttpRequest object for this builder.Copyright © 2016 Google. All rights reserved.