Object -
grpc :
Headers
Provides actions to read/write header values in gRPC request/response message.
Methods
Check whether the requested header exists.
Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.
Gets all transport headers with the specified header name.
Sets the value of a transport header.
Adds the specified key/value pair as an HTTP header to the request.
Removes a transport header from the request.
Removes all transport headers from the message.
Check whether the requested header exists.
Parameters
- headerName string
-
The header name.
-
Return Type
(boolean) Returns true if header exists, false otherwise.
Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.
Parameters
- headerName string
-
The header name.
-
Return Type
(string?) Returns first header value if exists, nil otherwise.
Gets all transport headers with the specified header name.
Parameters
- headerName string
-
The header name.
-
Return Type
(string[]) Returns header value array.
Sets the value of a transport header.
Adds the specified key/value pair as an HTTP header to the request.