webber

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 11 Imported by: 0

README

webber

An http request library in Go

Documentation

Index

Constants

View Source
const (
	ContentTypeApplicationJSON = "application/json"
	ContentTypeFormEncoded     = "application/x-www-form-urlencoded"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	URI         string
	Headers     map[string]string
	Method      string
	ContentType string

	TimeoutInMs int
	EnableGzip  bool
	// contains filtered or unexported fields
}

func (*Request) Do

func (r *Request) Do() (*Response, error)

func (*Request) Get

func (r *Request) Get(params map[string]string) (*Response, error)

func (*Request) Post

func (r *Request) Post(payload interface{}) (*Response, error)

type Response

type Response struct {
	*http.Response
	Data []byte
}

func NewResponse

func NewResponse(r *http.Response) *Response

func (*Response) Read

func (r *Response) Read(uncompress bool) error

Jump to

Keyboard shortcuts

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