part

package
v0.22.19 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 17 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cookies_List_2_Map

func Cookies_List_2_Map(Cookies []*http.Cookie) (o map[string]string)

func Cookies_String_2_Map

func Cookies_String_2_Map(Cookies string) (o map[string]string)

func IsCancel

func IsCancel(e error) bool

func IsTimeout

func IsTimeout(e error) bool

func Map_2_Cookies_String

func Map_2_Cookies_String(Cookies map[string]string) (o string)

func ToForm added in v0.9.12

func ToForm(m map[string]string) (postStr string, contentType string)

Types

type CookieJson added in v0.6.0

type CookieJson struct {
	Name  string `json:"Name"`
	Value string `json:"Value"`

	Path       string `json:"Path"`       // optional
	Domain     string `json:"Domain"`     // optional
	Expires    string `json:"Expires"`    // time.Time in RFC1123
	RawExpires string `json:"RawExpires"` // for reading cookies only

	// MaxAge=0 means no 'Max-Age' attribute specified.
	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
	// MaxAge>0 means Max-Age attribute present and given in seconds
	MaxAge   int           `json:"MaxAge"`
	Secure   bool          `json:"Secure"`
	HttpOnly bool          `json:"HttpOnly"`
	SameSite http.SameSite `json:"SameSite"` // Go 1.11
	Raw      string        `json:"Raw"`
	Unparsed []string      `json:"Unparsed"` // Raw text of unparsed attribute-value pairs
}

func (*CookieJson) FromCookie added in v0.6.0

func (t *CookieJson) FromCookie(cookie *http.Cookie)

func (*CookieJson) FromJson added in v0.6.0

func (t *CookieJson) FromJson(cookie_in_json []byte) error

func (*CookieJson) ToCookie added in v0.6.0

func (t *CookieJson) ToCookie() (http.Cookie, error)

func (*CookieJson) ToJson added in v0.6.0

func (t *CookieJson) ToJson() ([]byte, error)

type Req

type Req struct {
	Respon   []byte
	Response *http.Response
	UsedTime time.Duration
	// contains filtered or unexported fields
}

func New

func New() *Req

func (*Req) Cancel

func (t *Req) Cancel()

func (*Req) Close

func (t *Req) Close()

func (*Req) Reqf

func (t *Req) Reqf(val Rval) error

func (*Req) Reqf_1

func (t *Req) Reqf_1(val Rval) (err error)

func (*Req) Wait added in v0.19.0

func (t *Req) Wait() error

type Rval

type Rval struct {
	Url              string
	PostStr          string
	Timeout          int
	ReadTimeout      int // deprecated
	ConnectTimeout   int //	deprecated
	Proxy            string
	Retry            int
	SleepTime        int
	JustResponseCode bool
	NoResponse       bool
	Async            bool
	Cookies          []*http.Cookie

	SaveToPath       string
	SaveToChan       chan []byte
	SaveToPipeWriter *io.PipeWriter

	Header map[string]string
}

Jump to

Keyboard shortcuts

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