Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRequest ¶
func DefaultRequest(req *Request)
func SortParams ¶
So far only string data has been parsed The following analysis is based on actual needs !!! Null data is filtered
Types ¶
type ReqParams ¶
type ReqParams map[string]interface{}
func Struct2Params ¶
Transform any structure into a standard transmission data format Currently, null data filtering is not supported
type Request ¶
type Request struct { Path string Params ReqParams Method RequestMethod Header map[string]string ContentType RequestContentType Payload *Payload RawQuery string BasicAuthKey string }
func NewRequest ¶
func NewRequest(Path string, Options ...RequestOptions) *Request
type RequestContentType ¶
type RequestContentType string
const ( Json RequestContentType = "application/json" FormUrl RequestContentType = "application/x-www-form-urlencoded" MulFormData RequestContentType = "multipart/form-data" )
type RequestMethod ¶
type RequestMethod string
const ( POST RequestMethod = "POST" GET RequestMethod = "GET" PUT RequestMethod = "PUT" )
type RequestOptions ¶
type RequestOptions func(*Request)
func SetContentType ¶
func SetContentType(content RequestContentType) RequestOptions
func SetHeader ¶
func SetHeader(Header map[string]string) RequestOptions
func SetMethod ¶
func SetMethod(method RequestMethod) RequestOptions
func SetParams ¶
func SetParams(Params ReqParams) RequestOptions
func SetRawQuery ¶
func SetRawQuery(RawQuery string) RequestOptions
Click to show internal directories.
Click to hide internal directories.