http

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 7 Imported by: 0

README

http

Documentation

Index

Constants

View Source
const (
	MethodPost = fasthttp.MethodPost
	MethodGet  = fasthttp.MethodGet
	MethodPut  = fasthttp.MethodPut
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	Value string
}
type Header struct {
	// contains filtered or unexported fields
}

func (*Header) Cookie added in v0.1.3

func (h *Header) Cookie(key string) *Cookie

func (*Header) Get added in v0.1.2

func (r *Header) Get(key string) string

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest added in v0.1.2

func NewRequest(method, url string, body io.Reader) *Request

func (*Request) Do added in v0.2.0

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

func (*Request) DoTimeout added in v0.2.0

func (r *Request) DoTimeout(timeout time.Duration) (*Response, error)

func (*Request) Get

func (r *Request) Get(url string) (*Response, error)

func (*Request) Post

func (r *Request) Post(url string, body io.Reader) (*Response, error)

func (*Request) Put

func (r *Request) Put(url string, body io.Reader) (*Response, error)

func (*Request) SetHeader

func (r *Request) SetHeader(key, val string)

func (*Request) SetQuery

func (r *Request) SetQuery(key, val string)

func (*Request) SetQueryInt

func (r *Request) SetQueryInt(key string, val int)

type Response

type Response struct {
	// contains filtered or unexported fields
}

func Get

func Get(url string) (*Response, error)

func Post

func Post(url, contentType string, body io.Reader) (*Response, error)

func Put

func Put(url, contentType string, body io.Reader) (*Response, error)

func (*Response) Body

func (r *Response) Body() io.ReadCloser

func (*Response) Error

func (r *Response) Error() error

func (*Response) Header added in v0.1.2

func (r *Response) Header() *Header

func (*Response) IsError

func (r *Response) IsError() bool

func (*Response) StatusCode

func (r *Response) StatusCode() int

Jump to

Keyboard shortcuts

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