http

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (*Header) Set added in v0.2.1

func (r *Header) Set(key, value 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