Reference documentation and code samples for the Google API Common Protos Client class HttpRequest.
A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.
Generated from protobuf message google.logging.type.HttpRequest
Namespace
Google \ Cloud \ Logging \ TypeMethods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ request_method
string
The request method. Examples: "GET"
, "HEAD"
, "PUT"
, "POST"
.
↳ request_url
string
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"
.
↳ request_size
int|string
The size of the HTTP request message in bytes, including the request headers and the request body.
↳ status
int
The response code indicating the status of response. Examples: 200, 404.
↳ response_size
int|string
The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
↳ user_agent
string
The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"
.
↳ remote_ip
string
The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1"
, "10.0.0.1:80"
, "FE80::0202:B3FF:FE1E:8329"
.
↳ server_ip
string
The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1"
, "10.0.0.1:80"
, "FE80::0202:B3FF:FE1E:8329"
.
↳ referer
↳ latency
Google\Protobuf\Duration
The request processing latency on the server, from the time the request was received until the response was sent.
↳ cache_lookup
bool
Whether or not a cache lookup was attempted.
↳ cache_hit
bool
Whether or not an entity was served from cache (with or without validation).
↳ cache_validated_with_origin_server
bool
Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit
is True.
↳ cache_fill_bytes
int|string
The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.
↳ protocol
string
Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
getRequestMethod
The request method. Examples: "GET"
, "HEAD"
, "PUT"
, "POST"
.
string
setRequestMethod
The request method. Examples: "GET"
, "HEAD"
, "PUT"
, "POST"
.
var
string
$this
getRequestUrl
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"
.
string
setRequestUrl
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"
.
var
string
$this
getRequestSize
The size of the HTTP request message in bytes, including the request headers and the request body.
int|string
setRequestSize
The size of the HTTP request message in bytes, including the request headers and the request body.
var
int|string
$this
getStatus
The response code indicating the status of response.
Examples: 200, 404.
int
setStatus
The response code indicating the status of response.
Examples: 200, 404.
var
int
$this
getResponseSize
The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
int|string
setResponseSize
The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
var
int|string
$this
getUserAgent
The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
CLR 1.0.3705)"
.
string
setUserAgent
The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
CLR 1.0.3705)"
.
var
string
$this
getRemoteIp
The IP address (IPv4 or IPv6) of the client that issued the HTTP
request. This field can include port information. Examples: "192.168.1.1"
, "10.0.0.1:80"
, "FE80::0202:B3FF:FE1E:8329"
.
string
setRemoteIp
The IP address (IPv4 or IPv6) of the client that issued the HTTP
request. This field can include port information. Examples: "192.168.1.1"
, "10.0.0.1:80"
, "FE80::0202:B3FF:FE1E:8329"
.
var
string
$this
getServerIp
The IP address (IPv4 or IPv6) of the origin server that the request was
sent to. This field can include port information. Examples: "192.168.1.1"
, "10.0.0.1:80"
, "FE80::0202:B3FF:FE1E:8329"
.
string
setServerIp
The IP address (IPv4 or IPv6) of the origin server that the request was
sent to. This field can include port information. Examples: "192.168.1.1"
, "10.0.0.1:80"
, "FE80::0202:B3FF:FE1E:8329"
.
var
string
$this
getReferer
The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions .
string
setReferer
The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions .
var
string
$this
getLatency
The request processing latency on the server, from the time the request was received until the response was sent.
hasLatency
clearLatency
setLatency
The request processing latency on the server, from the time the request was received until the response was sent.
$this
getCacheLookup
Whether or not a cache lookup was attempted.
bool
setCacheLookup
Whether or not a cache lookup was attempted.
var
bool
$this
getCacheHit
Whether or not an entity was served from cache (with or without validation).
bool
setCacheHit
Whether or not an entity was served from cache (with or without validation).
var
bool
$this
getCacheValidatedWithOriginServer
Whether or not the response was validated with the origin server before
being served from cache. This field is only meaningful if cache_hit
is
True.
bool
setCacheValidatedWithOriginServer
Whether or not the response was validated with the origin server before
being served from cache. This field is only meaningful if cache_hit
is
True.
var
bool
$this
getCacheFillBytes
The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.
int|string
setCacheFillBytes
The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.
var
int|string
$this
getProtocol
Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
string
setProtocol
Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
var
string
$this