Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Request Type TypeJSON = "json" TypeFormURLEncoded = "form" )
Variables ¶
This section is empty.
Functions ¶
func ParseJsonResponseToStruct ¶
func ParseJsonResponseToStruct(param ParamParseJsonResponseToStruct) (err error)
Types ¶
type ParamBasicAuth ¶ added in v1.0.12
type ParamHTTPRequest ¶
type ParamHTTPRequest struct {
Type string `json:"type" validate:"required,oneof=json form"`
Method string `json:"method" validate:"required,oneof=GET POST PUT PATCH DELETE"`
URL string `json:"url" validate:"required,http_url"`
Query map[string]string
BasicAuth ParamBasicAuth
Headers map[string]string
Body interface{}
RequestTimeout time.Duration
}
type ParamParseJsonResponseToStruct ¶
type ParamParseJsonResponseToStruct struct {
ResponseBody []byte
ResponseStruct interface{}
}
type ReturnHTTPRequest ¶
type ReturnHTTPRequest struct {
StatusText string
StatusCode int
Proto string
ContentLength int64
Header http.Header
ResponseBody []byte
}
func HTTPRequest ¶
func HTTPRequest(param ParamHTTPRequest) (returnData ReturnHTTPRequest, err error)
Click to show internal directories.
Click to hide internal directories.