Documentation ¶
Overview ¶
Manipulation of the response from the Service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
Holds this module's functions. Accessible as `kong.ServiceResponse`
func (Response) GetHeader ¶
kong.ServiceResponse.GetHeader() returns the value of the specified response header.
Unlike kong.Response.GetHeader(), this function will only return a header if it was present in the response from the Service (ignoring headers added by Kong itself).
func (Response) GetHeaders ¶
kong.ServiceResponse.GetHeaders() returns a map holding the headers from the response from the Service. Keys are header names. Values are either a string with the header value, or an array of strings if a header was sent multiple times. Header names in this table are case-insensitive and dashes (-) can be written as underscores (_); that is, the header X-Custom-Header can also be retrieved as x_custom_header.
Unlike kong.Response.GetHeaders(), this function will only return headers that were present in the response from the Service (ignoring headers added by Kong itself). If the request was not proxied to a Service (e.g. an authentication plugin rejected a request and produced an HTTP 401 response), then the returned headers value might be nil, since no response from the Service has been received.
The max_args argument specifies the maximum number of returned headers. Must be greater than 1 and not greater than 1000, or -1 to specify the default limit of 100 arguments.
func (Response) GetRawBody ¶
kong.ServiceResponse.GetRawBody() returns the raw body of the response from the Service.