request

package
v0.0.0-...-1b9e8c6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBody

func DecodeBody(obj interface{}, body io.ReadCloser) error

DecodeBody decodes body to obj.

func Delete

func Delete(endpoint string, opts ...Option) (*http.Response, error)

Delete sends request to the default pouchd server with custom request options.

func Get

func Get(endpoint string, opts ...Option) (*http.Response, error)

Get sends request to the default pouchd server with custom request options.

func Hijack

func Hijack(endpoint string, opts ...Option) (*http.Response, net.Conn, *bufio.Reader, error)

Hijack posts hijack request.

func Post

func Post(endpoint string, opts ...Option) (*http.Response, error)

Post sends post request to pouchd.

Types

type Option

type Option func(*http.Request) error

Option defines a type used to update http.Request.

func WithHeader

func WithHeader(key string, value string) Option

WithHeader sets the Header of http.Request.

func WithJSONBody

func WithJSONBody(obj interface{}) Option

WithJSONBody encodes the input data to JSON and sets it to the body in http.Request

func WithQuery

func WithQuery(query url.Values) Option

WithQuery sets the query field in URL.

Jump to

Keyboard shortcuts

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