fetch

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(resp *http.Response) ([]byte, error)

func CheckStatus

func CheckStatus(resp *http.Response) (*http.Response, error)

func Do

func Do(req Request) (*http.Response, error)

func Get

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

func Json

func Json(resp *http.Response) (any, error)

func Post

func Post(data any, url string) (*http.Response, error)

func SessionDo

func SessionDo(s Session, req Request) (*http.Response, error)

func SessionGet

func SessionGet(s Session, url string) (*http.Response, error)

func SessionPost

func SessionPost(s Session, data any, url string) (*http.Response, error)

func Text

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

Types

type Request

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

func BasicAuth

func BasicAuth(req Request, username string, password string) Request

func BearerAuth

func BearerAuth(req Request, token string) Request

func Body

func Body(req Request, data any) Request

func FormData

func FormData(req Request, data map[string]string) Request
func Header(req Request, name string, value string) Request

func Method

func Method(req Request, method string) Request

func New

func New(url string) Request

func Timeout

func Timeout(req Request, durationNs int64) Request

type Session

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

func NewSession

func NewSession() Session

func SessionHeader

func SessionHeader(s Session, name string, value string) Session

func SessionTimeout

func SessionTimeout(s Session, durationNs int64) Session

Jump to

Keyboard shortcuts

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