requests

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFastClient

func NewFastClient(rwTimeout time.Duration)

NewFastClient .

func Newh2cClient

func Newh2cClient(rwTimeout time.Duration)

Newh2cClient .

Types

type FastRequest

type FastRequest struct {
	// contains filtered or unexported fields
}

FastRequest .

func (*FastRequest) Delete

func (fr *FastRequest) Delete() Request

Delete .

func (*FastRequest) Get

func (fr *FastRequest) Get() Request

Get .

func (*FastRequest) Post

func (fr *FastRequest) Post() Request

Post .

func (*FastRequest) Put

func (fr *FastRequest) Put() Request

Put .

func (*FastRequest) SetBody

func (fr *FastRequest) SetBody(byts []byte) Request

SetBody .

func (*FastRequest) SetContext added in v1.3.1

func (fr *FastRequest) SetContext(ctx context.Context) Request

SetContext .

func (*FastRequest) SetHeader

func (fr *FastRequest) SetHeader(key, value string) Request

SetHeader .

func (*FastRequest) SetJSONBody

func (fr *FastRequest) SetJSONBody(obj interface{}) Request

SetJSONBody .

func (*FastRequest) SetParam

func (fr *FastRequest) SetParam(key string, value interface{}) Request

SetParam .

func (*FastRequest) SkipBus added in v0.0.3

func (fr *FastRequest) SkipBus() Request

SkipBus .

func (*FastRequest) ToBytes

func (fr *FastRequest) ToBytes() (value []byte, r Response)

ToBytes .

func (*FastRequest) ToJSON

func (fr *FastRequest) ToJSON(obj interface{}) (r Response)

ToJSON .

func (*FastRequest) ToString

func (fr *FastRequest) ToString() (value string, r Response)

ToString .

func (*FastRequest) ToXML

func (fr *FastRequest) ToXML(v interface{}) (r Response)

ToXML .

func (*FastRequest) URI

func (fr *FastRequest) URI() string

URI .

type H2CRequest

type H2CRequest struct {
	// contains filtered or unexported fields
}

H2CRequest .

func (*H2CRequest) Delete

func (hr *H2CRequest) Delete() Request

// Delete .

func (*H2CRequest) Get

func (hr *H2CRequest) Get() Request

Get .

func (*H2CRequest) Post

func (hr *H2CRequest) Post() Request

Post .

func (*H2CRequest) Put

func (hr *H2CRequest) Put() Request

Put .

func (*H2CRequest) SetBody

func (hr *H2CRequest) SetBody(byts []byte) Request

SetBody .

func (*H2CRequest) SetContext added in v1.3.1

func (hr *H2CRequest) SetContext(ctx context.Context) Request

SetContext .

func (*H2CRequest) SetHeader

func (hr *H2CRequest) SetHeader(key, value string) Request

SetHeader .

func (*H2CRequest) SetJSONBody

func (hr *H2CRequest) SetJSONBody(obj interface{}) Request

SetJSONBody .

func (*H2CRequest) SetParam

func (hr *H2CRequest) SetParam(key string, value interface{}) Request

SetParam .

func (*H2CRequest) SkipBus added in v0.0.3

func (hr *H2CRequest) SkipBus() Request

SkipBus .

func (*H2CRequest) ToBytes

func (hr *H2CRequest) ToBytes() (value []byte, r Response)

ToBytes .

func (*H2CRequest) ToJSON

func (hr *H2CRequest) ToJSON(obj interface{}) (r Response)

ToJSON .

func (*H2CRequest) ToString

func (hr *H2CRequest) ToString() (value string, r Response)

ToString .

func (*H2CRequest) ToXML

func (hr *H2CRequest) ToXML(v interface{}) (r Response)

ToXML .

func (*H2CRequest) URI

func (hr *H2CRequest) URI() string

URI .

type Request

type Request interface {
	Post() Request
	Put() Request
	Get() Request
	Delete() Request
	SetJSONBody(obj interface{}) Request
	SetBody(byts []byte) Request
	//跳过总线数据,上下游header携带
	SkipBus() Request
	ToJSON(obj interface{}) Response
	ToString() (string, Response)
	ToBytes() ([]byte, Response)
	ToXML(v interface{}) Response
	SetHeader(key, value string) Request
	SetParam(key string, value interface{}) Request
	URI() string
	SetContext(context.Context) Request
}

Request .

func NewFastRequest

func NewFastRequest(uri string, bus ...string) Request

NewFastRequest .

func NewH2CRequest

func NewH2CRequest(rawurl string, bus ...string) Request

type Response

type Response struct {
	Error         error
	Header        map[string]string
	ContentLength int64
	ContentType   string
	StatusCode    int
	HTTP11        bool
}

Response .

Jump to

Keyboard shortcuts

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