Documentation ¶
Index ¶
- type FormFile
- type Requester
- func Get(toURL string, v ...interface{}) *Requester
- func New(method, toURL string) *Requester
- func NewWithClient(method, toURL string, client *http.Client) *Requester
- func Post(toURL string) *Requester
- func PostData(toURL, contentType string, v interface{}) *Requester
- func PostForm(toURL string, v interface{}) *Requester
- func PostJSON(toURL string, v interface{}) *Requester
- func (req *Requester) AddFormField(key string, val interface{}) *Requester
- func (req *Requester) AddFormFile(files ...*FormFile) *Requester
- func (req *Requester) AddHeader(key, val string) *Requester
- func (req *Requester) AddRawQuery(v ...interface{}) *Requester
- func (req *Requester) Client() *http.Client
- func (req *Requester) Do() (*http.Response, error)
- func (req *Requester) FormFields() url.Values
- func (req *Requester) RawData() []byte
- func (req *Requester) ReadData() ([]byte, error)
- func (req *Requester) ReadJSON(v interface{}) error
- func (req *Requester) ReadString() (string, error)
- func (req *Requester) Request() *http.Request
- func (req *Requester) SetFormField(key string, val interface{}) *Requester
- func (req *Requester) SetFormFields(v interface{}) *Requester
- func (req *Requester) SetHeader(key, val string) *Requester
- func (req *Requester) SetRawData(v interface{}) *Requester
- func (req *Requester) SetRawQuery(v ...interface{}) *Requester
- func (req *Requester) URL() *url.URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormFile ¶
type FormFile struct { FieldName string `json:"field_name,omitempty"` FilePath string `json:"file_path,omitempty"` FileName string `json:"file_name,omitempty"` }
FormFile 文件表单数据
type Requester ¶
type Requester struct { Error error // contains filtered or unexported fields }
Requester http.Request
func NewWithClient ¶
NewWithClient 创建一个基础 Requester
func (*Requester) AddFormField ¶
AddFormField 追加 formField
func (*Requester) AddFormFile ¶
AddFormFile 追加 formFile
func (*Requester) AddRawQuery ¶
AddRawQuery 追加 RawQuery
func (*Requester) FormFields ¶ added in v1.0.1
FormFields FormFields
func (*Requester) ReadString ¶
ReadString 获取响应字符串响应
func (*Requester) SetFormField ¶
SetFormField 设置 formField
func (*Requester) SetFormFields ¶
SetFormFields 设置 formField v type in ( string, struct, map[string]string, map[string][]string, map[string]int, map[string][]int )
func (*Requester) SetRawData ¶
SetRawData 设置 RawData
func (*Requester) SetRawQuery ¶
SetRawQuery 重设 RawQuery
Click to show internal directories.
Click to hide internal directories.