request

package
v0.0.0-...-1528947 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL     *url.URL
	BaseHeaders *http.Header
	HttpClient  *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL string, baseHeaders http.Header) (*Client, error)

func (*Client) AddHeader

func (c *Client) AddHeader(key, value string)

func (*Client) Get

func (c *Client) Get(uri string, header http.Header) (*Response, error)

func (*Client) Post

func (c *Client) Post(uri string, body interface{}, header http.Header) (*Response, error)

func (*Client) Put

func (c *Client) Put(uri string, body interface{}, header http.Header) (*Response, error)

type Request

type Request struct {
	http.Request
}

type Response

type Response struct {
	http.Response
}

func (*Response) Decode

func (resp *Response) Decode(s interface{}) error

func (*Response) Download

func (resp *Response) Download(to string) (error, int64)

func (*Response) GetContentType

func (resp *Response) GetContentType() (string, error)

Jump to

Keyboard shortcuts

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