http

package
v0.0.0-...-5a547ea Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteRequestBody

func ByteRequestBody(req *http.Request) (data []byte, err error)

func ByteRequestBodyNoClose

func ByteRequestBodyNoClose(req *http.Request) (data []byte, err error)

func ByteResponseBody

func ByteResponseBody(resp *http.Response) (data []byte, err error)

func StringRequestBody

func StringRequestBody(req *http.Request) (string, error)

func StringRequestBodyNoClose

func StringRequestBodyNoClose(req *http.Request) (string, error)

func StringResponseBody

func StringResponseBody(resp *http.Response) (string, error)

Types

type HttpClient

type HttpClient struct {
	Header map[string]string
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient() *HttpClient

func NewHttpClientWithCAs

func NewHttpClientWithCAs(cas ...string) *HttpClient

func (*HttpClient) Clear

func (s *HttpClient) Clear()

func (*HttpClient) Delete

func (s *HttpClient) Delete(uri string, data interface{}) (*http.Response, error)

func (*HttpClient) Get

func (s *HttpClient) Get(uri string) (*http.Response, error)

func (*HttpClient) GetFile

func (s *HttpClient) GetFile(uri string, filepath string) (*http.Response, error)

func (*HttpClient) Post

func (s *HttpClient) Post(uri string, data []byte, header map[string][]string) (*http.Response, error)

func (*HttpClient) PostFile

func (s *HttpClient) PostFile(uri string, filepath string) (*http.Response, error)

func (*HttpClient) PostForm

func (s *HttpClient) PostForm(uri string, data map[string]string) (*http.Response, error)

func (*HttpClient) PostJSON

func (s *HttpClient) PostJSON(uri string, data interface{}) (*http.Response, error)

func (*HttpClient) Put

func (s *HttpClient) Put(uri string, data interface{}) (*http.Response, error)

func (*HttpClient) SetHeader

func (s *HttpClient) SetHeader(key, value string) *HttpClient

Jump to

Keyboard shortcuts

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