Documentation
¶
Index ¶
- Constants
- type Request
- func (m *Request) AddCookie(cookie *http.Cookie) *Request
- func (m *Request) AddHeader(key, value string) *Request
- func (m *Request) Exec() *Response
- func (m *Request) RemoveFile() *Request
- func (m *Request) SetBody(body io.Reader) *Request
- func (m *Request) SetContentType(contentType string) *Request
- func (m *Request) SetFile(field, fileName, path string) (err error)
- func (m *Request) SetForm(key, value string) *Request
- func (m *Request) SetForms(v any) *Request
- func (m *Request) SetHeader(key, value string) *Request
- func (m *Request) SetHeaders(headers any) *Request
- func (m *Request) SetJsonBody(v any) *Request
- func (m *Request) SetTimeout(timeout time.Duration) *Request
- func (m *Request) SetUrlValue(key, value string) *Request
- func (m *Request) SetUrlValues(v any) *Request
- type Response
Constants ¶
View Source
const ( GET = http.MethodGet POST = http.MethodPost DELETE = http.MethodDelete PUT = http.MethodPut PATCH = http.MethodPatch HEAD = http.MethodHead OPTIONS = http.MethodOptions ContentTypeJSON = "application/json" ContentTypeFormUrl = "application/x-www-form-urlencoded" ContentTypeFormData = "multipart/form-data" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
Request Http Request
func (*Request) RemoveFile ¶
func (*Request) SetContentType ¶
func (*Request) SetHeaders ¶
func (*Request) SetJsonBody ¶ added in v1.2.1
func (*Request) SetTimeout ¶ added in v1.2.5
func (*Request) SetUrlValue ¶ added in v1.2.1
func (*Request) SetUrlValues ¶ added in v1.2.1
SetUrlValues struct to Params
type Response ¶
Response Http请求返回内容
func (*Response) MustString ¶
func (*Response) StatusCode ¶ added in v1.2.5
Click to show internal directories.
Click to hide internal directories.