resty

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 13 Imported by: 11

Documentation

Index

Constants

View Source
const (
	HeaderAccept    = "Accept"
	HeaderUserAgent = "User-Agent"
)
View Source
const (
	MIMEApplicationJSON = "application/json"
	MIMEApplicationXML  = "application/xml"
)
View Source
const (
	UAWindowsChrome = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
	UAWindowsEdge   = "" /* 129-byte string literal not displayed */
	UAMacOSChrome   = "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
	UAMacOSSafari   = "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15"
	UAAndroidChrome = "Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.66 Mobile Safari/537.36"
	UAIOSSafari     = "" /* 135-byte string literal not displayed */
)

Variables

Functions

func ParseResp

func ParseResp[Err iRespErr, Res iRespRes](resp *Response, ee error) (t Res, _ error)

func WithAccept

func WithAccept(accept string) rOptionI

func WithUserAgent

func WithUserAgent(useragent string) rOptionI

Types

type Client

type Client = resty.Client

func C

func C() *Client

func New

func New() *Client

type Request

type Request = resty.Request

func R

func R(ros ...rOptionI) *Request

type RespErr

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

func AsRespErr

func AsRespErr(err error) (*RespErr, bool)

func (*RespErr) Error

func (e *RespErr) Error() string

type Response

type Response = resty.Response

Jump to

Keyboard shortcuts

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