Documentation
¶
Index ¶
- type Request
- func (r Request) AddHeader(name string, value string) error
- func (r Request) ClearHeader(name string) error
- func (r Request) SetHeader(name string, value string) error
- func (r Request) SetHeaders(headers map[string]interface{}) error
- func (r Request) SetMethod(method string) error
- func (r Request) SetPath(path string) error
- func (r Request) SetQuery(query map[string]interface{}) error
- func (r Request) SetRawBody(body string) error
- func (r Request) SetRawQuery(query string) error
- func (r Request) SetScheme(scheme string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
func (Request) ClearHeader ¶
func (Request) SetHeaders ¶
func (Request) SetQuery ¶
kong.ServiceRequest.SetQuery() sets the querystring of the request to the Service.
Unlike kong.ServiceRequest.SetRawQuery(), the query argument must be a map in which each key is a string (corresponding to an arguments name), and each value is either a boolean, a string or an array of strings or booleans. Additionally, all string values will be URL-encoded.
The resulting querystring will contain keys in their lexicographical order. The order of entries within the same key (when values are given as an array) is retained.
If further control of the querystring generation is needed, a raw querystring can be given as a string with kong.ServiceRequest.SetRawQuery().
func (Request) SetRawBody ¶
kong.ServiceRequest SetRawBody() sets the body of the request to the Service.
The body argument must be a string and will not be processed in any way. This function also sets the Content-Length header appropriately. To set an empty body, one can give an empty string "" to this function.
For a higher-level function to set the body based on the request content type, see kong.ServiceRequest.SetBody().
func (Request) SetRawQuery ¶
kong.ServiceRequest.SetRawQuery() sets the querystring of the request to the Service. The query argument is a string (without the leading ? character), and will not be processed in any way.
For a higher-level function to set the query string from a ???? of arguments, see kong.ServiceRequest.SetQuery().