httpclient

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FORM_URLENCODED = "application/x-www-form-urlencoded"
	JSON            = "application/json"
	XML             = "application/xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	*http.Client
	Hook IHook
}

func NewClient

func NewClient(options ...func(*HttpClient)) *HttpClient

func (*HttpClient) Do

func (h *HttpClient) Do(req *http.Request) (resp *http.Response, err error)

func (*HttpClient) Get

func (h *HttpClient) Get(url string, options ...func(r *http.Request)) (resp *http.Response, err error)

func (*HttpClient) Post

func (h *HttpClient) Post(url string, contentType string, body io.Reader, options ...func(r *http.Request)) (resp *http.Response, err error)

type IHook

type IHook interface {
	Befor(req *http.Request)
	After(req *http.Request, rep *http.Response, err error)
}

Jump to

Keyboard shortcuts

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