Send feedback
Class HttpRequest (3.16.2)
Stay organized with collections
Save and categorize content based on your preferences.
Version 3.16.2 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
Static Methods
newBuilder()
public static HttpRequest . Builder newBuilder ()
Returns a builder for HttpRequest
objects.
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
.
cacheLookup()
public boolean cacheLookup ()
Returns whether or not a cache lookup was attempted. If not set, this method returns
false
.
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
.
equals(Object obj)
public boolean equals ( Object obj )
Parameter Name Description obj
Object
Overrides
getCacheFillBytes()
public Long getCacheFillBytes ()
Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was
attempted.
Returns Type Description Long
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 ()
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
.
getRequestMethod()
public HttpRequest . RequestMethod getRequestMethod ()
Returns the HTTP request method.
getRequestSize()
public Long getRequestSize ()
Returns the size of the HTTP request message in bytes, including the request headers and the
request body.
Returns Type Description Long
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
.
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 Type Description Long
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
.
getStatus()
public Integer getStatus ()
Returns the response code indicating the status of response.
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)
.
hashCode()
Returns Type Description int
Overrides
toBuilder()
public HttpRequest . Builder toBuilder ()
Returns a builder for this object.
toString()
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-11-19 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-11-19 UTC."],[],[]]