httpclient

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpError

type HttpError struct {
	Code   int
	Reason string
}

func (*HttpError) Error

func (err *HttpError) Error() string

type Response

type Response struct {
	Status  int
	Body    []byte
	Headers http.Header
}

func (*Response) BodyString

func (resp *Response) BodyString() string

func (*Response) BodyUnmarshal

func (resp *Response) BodyUnmarshal(object interface{}) error

func (*Response) GetHeader

func (resp *Response) GetHeader(key string) string

func (*Response) JudgeStatus

func (resp *Response) JudgeStatus() error

type Session

type Session struct {
}

func (*Session) Delete

func (session *Session) Delete(url string, headers map[string]string) (*Response, error)

func (*Session) Get

func (session *Session) Get(url string, query map[string]string, headers map[string]string) (*Response, error)

func (*Session) Post

func (session *Session) Post(url string, body []byte, headers map[string]string) (*Response, error)

func (*Session) Put

func (session *Session) Put(url string, body []byte, headers map[string]string) (*Response, error)

func (*Session) Request

func (session *Session) Request(req *http.Request, headers map[string]string) (*Response, error)

Jump to

Keyboard shortcuts

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