Reference documentation and code samples for the Google API Common Protos Client class Response.
This message defines attributes for a typical network response. It generally models semantics of an HTTP response.
Generated from protobuf message google.rpc.context.AttributeContext.Response
Namespace
Google \ Rpc \ Context \ AttributeContextMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ code |
int|string
The HTTP response status code, such as |
↳ size |
int|string
The HTTP response size in bytes. If unknown, it must be -1. |
↳ headers |
array|Google\Protobuf\Internal\MapField
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive. |
↳ time |
Google\Protobuf\Timestamp
The timestamp when the |
↳ backend_latency |
Google\Protobuf\Duration
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend. |
getCode
The HTTP response status code, such as 200
and 404
.
Returns | |
---|---|
Type | Description |
int|string |
setCode
The HTTP response status code, such as 200
and 404
.
Parameter | |
---|---|
Name | Description |
var |
int|string
|
Returns | |
---|---|
Type | Description |
$this |
getSize
The HTTP response size in bytes. If unknown, it must be -1.
Returns | |
---|---|
Type | Description |
int|string |
setSize
The HTTP response size in bytes. If unknown, it must be -1.
Parameter | |
---|---|
Name | Description |
var |
int|string
|
Returns | |
---|---|
Type | Description |
$this |
getHeaders
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\MapField |
setHeaders
The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
Parameter | |
---|---|
Name | Description |
var |
array|Google\Protobuf\Internal\MapField
|
Returns | |
---|---|
Type | Description |
$this |
getTime
The timestamp when the destination
service sends the last byte of
the response.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasTime
clearTime
setTime
The timestamp when the destination
service sends the last byte of
the response.
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getBackendLatency
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Duration|null |
hasBackendLatency
clearBackendLatency
setBackendLatency
The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Duration
|
Returns | |
---|---|
Type | Description |
$this |