libs

package
v0.0.0-...-37d0726 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeURL

func MakeURL(scheme, host, path string, args url.Values) string

MakeURL encode to full url request

Types

type HTTPClient

type HTTPClient struct {
	Client *http.Client
}

HTTPClient wrapper for http client

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *HTTPClient

NewHTTPClient new http client wrapper

func (*HTTPClient) Delete

func (c *HTTPClient) Delete(url string) (statusCode int, err error)

Delete make delete method request

func (*HTTPClient) Get

func (c *HTTPClient) Get(scheme, host, path string, values url.Values) (respBody []byte, statusCode int, err error)

Get make get request

func (*HTTPClient) GetWithHeaders

func (c *HTTPClient) GetWithHeaders(fullURL string, headers map[string]string) (respBody []byte, statusCode int, err error)

GetWithHeaders do get with customer headers

func (*HTTPClient) GetWithURL

func (c *HTTPClient) GetWithURL(fullURL string) (respBody []byte, statusCode int, err error)

GetWithURL do http get with full url/uri

func (*HTTPClient) PostForm

func (c *HTTPClient) PostForm(_url string, values url.Values) (respBody []byte, statusCode int, err error)

PostForm do post with post form values

func (*HTTPClient) Upload

func (c *HTTPClient) Upload(uploadURL string, filename string, reader io.Reader, isGzipped bool, mtype string) (respBody []byte, statusCode int, err error)

Upload file content

Jump to

Keyboard shortcuts

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