request

package
v0.0.0-...-133876f Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDebug

func SetDebug()

func SetTimeout

func SetTimeout(d time.Duration)

Types

type Body

type Body struct {
	*goreq.Body
}

Body is wrapper struct for goreq.Body

func (*Body) DebugPrint

func (b *Body) DebugPrint()

func (*Body) ParseXML

func (b *Body) ParseXML(s interface{}) error

ParseXML assigns request body data(XML) to entity

func (*Body) ToByte

func (b *Body) ToByte() ([]byte, error)

ToByte converts request body to []byte

func (*Body) ToMap

func (b *Body) ToMap() (map[string]interface{}, error)

ToMap converts request body to map

type DSN

type DSN struct {
	goreq.Request

	Method  string
	Uri     string
	Timeout time.Duration
	Params  interface{}
}

DSN has request data

func (*DSN) BasicAuth

func (d *DSN) BasicAuth(user, pass string) *DSN

func (DSN) Call

func (d DSN) Call() (*Body, error)

Call sends request to endpoint with parameter(p)

func (DSN) DELETE

func (d DSN) DELETE() (*Body, error)

func (DSN) Debug

func (d DSN) Debug() DSN

func (DSN) GET

func (d DSN) GET() (*Body, error)

func (DSN) POST

func (d DSN) POST() (*Body, error)

func (DSN) PUT

func (d DSN) PUT() (*Body, error)

func (*DSN) Param

func (d *DSN) Param(p interface{}) *DSN

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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