Send feedback
Class HttpRequest (3.9.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 3.9.0 keyboard_arrow_down
public final class HttpRequest implements Serializable
Objects of this class represent information about the (optional) HTTP request associated with a
log entry.
See Also: Http Request
Inheritance
Object >
HttpRequest
Static Fields
EMPTY
public static final HttpRequest EMPTY
Field Value
Static Methods
newBuilder()
public static HttpRequest . Builder newBuilder ()
Returns a builder for HttpRequest
objects.
Returns
Methods
cacheHit()
public boolean cacheHit ()
Returns whether or not an entity was served from cache (with or without validation). If not
set, this method returns false
.
Returns
cacheLookup()
public boolean cacheLookup ()
Returns whether or not a cache lookup was attempted. If not set, this method returns
false
.
Returns
cacheValidatedWithOriginServer()
public boolean cacheValidatedWithOriginServer ()
Returns whether or not the response was validated with the origin server before being served
from cache. If not set, this method returns false
. This field is only meaningful if
#cacheHit() is set to true
.
Returns
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Returns
Overrides
getCacheFillBytes()
public Long getCacheFillBytes ()
Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was
attempted.
Returns
getLatency()
public Duration getLatency ()
Returns the processing latency on the server, from the time the request was received until the
response was sent.
Returns
Type Description org.threeten.bp.Duration the latency, for null if not populated.
getReferer()
public String getReferer ()
Returns
getRemoteIp()
public String getRemoteIp ()
Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples:
192.168.1.1
, FE80::0202:B3FF:FE1E:8329
.
Returns
getRequestMethod()
public HttpRequest . RequestMethod getRequestMethod ()
Returns the HTTP request method.
Returns
getRequestSize()
public Long getRequestSize ()
Returns the size of the HTTP request message in bytes, including the request headers and the
request body.
Returns
getRequestUrl()
public String getRequestUrl ()
Returns the requested URL. Request URL contains the scheme (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
.
Returns
getResponseSize()
public Long getResponseSize ()
Returns the size of the HTTP response message sent back to the client, in bytes, including the
response headers and the response body.
Returns
getServerIp()
public String getServerIp ()
Returns the IP address (IPv4 or IPv6) of the origin server that the request was sent to.
Examples: 192.168.1.1
, FE80::0202:B3FF:FE1E:8329
.
Returns
getStatus()
public Integer getStatus ()
Returns the response code indicating the status of response.
Returns
getUserAgent()
public String getUserAgent ()
Returns the user agent sent by the client. Example: Mozilla/4.0 (compatible; MSIE 6.0;
Windows 98; Q312461; .NET CLR 1.0.3705)
.
Returns
hashCode()
Returns
Overrides
toBuilder()
public HttpRequest . Builder toBuilder ()
Returns a builder for this object.
Returns
toString()
Returns
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-30 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-30 UTC."],[],[]]