request

package
v0.0.0-...-f2d3d7a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(endpoint string) (*http.Response, error)

Debug sends request to the default pouchd server to get the debug info.

NOTE: without any vesion information.

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 WithContext

func WithContext(ctx context.Context) Option

WithContext sets the ctx of 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