request

package
v0.0.0-...-8d72184 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	bridge.PdkBridge
}

func New

func New(ch chan interface{}) Request

func (Request) AddHeader

func (r Request) AddHeader(name string, value string) error

func (Request) ClearHeader

func (r Request) ClearHeader(name string) error

func (Request) SetHeader

func (r Request) SetHeader(name string, value string) error

func (Request) SetHeaders

func (r Request) SetHeaders(headers map[string]interface{}) error

func (Request) SetMethod

func (r Request) SetMethod(method string) error

func (Request) SetPath

func (r Request) SetPath(path string) error

func (Request) SetQuery

func (r Request) SetQuery(query map[string]interface{}) error

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

func (r Request) SetRawBody(body string) error

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

func (r Request) SetRawQuery(query string) error

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().

func (Request) SetScheme

func (r Request) SetScheme(scheme string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL