Documentation ¶
Index ¶
- func Struct2Map(obj interface{}, tagName string) map[string]interface{}
- func StructPtr2Map(obj interface{}, tagName string) map[string]interface{}
- type Request
- func (req *Request) BaseReq(Method, urlStr string, options ...interface{}) (resp *Response, err error)
- func (req *Request) Cookie()
- func (req *Request) Delete(urlStr string, options ...interface{}) (resp *Response, err error)
- func (req *Request) Do() (*Response, error)
- func (req *Request) EnableCookie(enable bool)
- func (req *Request) Get(urlStr string, options ...interface{}) (resp *Response, err error)
- func (req *Request) Header()
- func (req *Request) Patch(urlStr string, options ...interface{}) (resp *Response, err error)
- func (req *Request) Post(urlStr string, options ...interface{}) (resp *Response, err error)
- func (req *Request) Put(urlStr string, options ...interface{}) (resp *Response, err error)
- func (req *Request) SetBasicAuth(username, password string)
- func (req *Request) SetTimeout(n time.Duration)
- type Response
- func Delete(urlStr string, options ...interface{}) (resp *Response, err error)
- func Get(urlStr string, options ...interface{}) (resp *Response, err error)
- func Patch(urlStr string, options ...interface{}) (resp *Response, err error)
- func Post(urlStr string, options ...interface{}) (resp *Response, err error)
- func Put(urlStr string, options ...interface{}) (resp *Response, err error)
- func (res *Response) Body() (body io.ReadCloser)
- func (res *Response) Content() (content []byte)
- func (res *Response) Cookie() []*http.Cookie
- func (res *Response) Header() map[string][]string
- func (res *Response) Json() Value
- func (res *Response) RawJson(v interface{}) error
- func (res *Response) SetRes(rawRes *http.Response)
- func (res *Response) Status() int
- func (res *Response) Text() (text string)
- type Value
- func (v Value) Bool() bool
- func (v Value) Float64() float64
- func (v Value) Get(path ...interface{}) Value
- func (v Value) Int64() int64
- func (v Value) Map() map[string]interface{}
- func (v Value) Size() int
- func (v Value) String() string
- func (v Value) StringArray(path ...interface{}) []string
- func (v Value) Time(layout string, options ...string) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Struct2Map ¶
Struct2Map 结构体转map,传入结构体
func StructPtr2Map ¶
StructPtr2Map 结构体指针转map,传入结构体指针
Types ¶
type Request ¶
type Request struct { Headers map[string]string Cookies map[string]string Params url.Values // contains filtered or unexported fields }
Request 请求相关
func (*Request) EnableCookie ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response 响应相关
func (*Response) Body ¶
func (res *Response) Body() (body io.ReadCloser)
Click to show internal directories.
Click to hide internal directories.