Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Transport *http.Transport CheckRedirect func(req *http.Request, via []*http.Request) error Jar http.CookieJar TimeOut time.Duration Debug bool //debug 模式 }
config struct
type HttpRequest ¶ added in v0.0.4
func NewRequest ¶
func NewRequest(method, rawurl string, body []byte, debug bool) (*HttpRequest, error)
func (*HttpRequest) AddCookie ¶ added in v1.0.2
func (r *HttpRequest) AddCookie(cookies []*http.Cookie) *HttpRequest
AddCookie 设置cookie
func (*HttpRequest) Prepare ¶ added in v0.0.4
func (r *HttpRequest) Prepare() *http.Request
Prepare 准备request
func (*HttpRequest) SetHeader ¶ added in v0.0.4
func (r *HttpRequest) SetHeader(params map[string]any) *HttpRequest
SetHeader 设置头信息
type HttpResponse ¶
func NewHttpResponse ¶
func NewHttpResponse(response *http.Response) *HttpResponse
func (*HttpResponse) GetCookie ¶ added in v1.0.2
func (r *HttpResponse) GetCookie(names ...string) map[string]*http.Cookie
func (*HttpResponse) GetData ¶
func (r *HttpResponse) GetData() ([]byte, error)
func (*HttpResponse) GetDataFromHeader ¶
func (r *HttpResponse) GetDataFromHeader(key string) string
func (*HttpResponse) GetHeaderCode ¶
func (r *HttpResponse) GetHeaderCode() int
Click to show internal directories.
Click to hide internal directories.