Documentation
¶
Index ¶
- func DeleteAndParse[T any](client *http.Client, url string, options ...HttpOptions) (*T, error)
- func GetAndParse[T any](client *http.Client, url string, options ...HttpOptions) (*T, error)
- func GetAndParseStream[T any](client *http.Client, url string, options ...HttpOptions) (*stream.Stream[T], error)
- func PatchAndParse[T any](client *http.Client, url string, options ...HttpOptions) (*T, error)
- func PostAndParse[T any](client *http.Client, url string, options ...HttpOptions) (*T, error)
- func PostAndParseStream[T any](client *http.Client, url string, options ...HttpOptions) (*stream.Stream[T], error)
- func PutAndParse[T any](client *http.Client, url string, options ...HttpOptions) (*T, error)
- func PutAndParseStream[T any](client *http.Client, url string, options ...HttpOptions) (*stream.Stream[T], error)
- func Request(client *http.Client, url string, method string, options ...HttpOptions) (*http.Response, error)
- func RequestAndParse[T any](client *http.Client, url string, method string, options ...HttpOptions) (*T, error)
- func RequestAndParseStream[T any](client *http.Client, url string, method string, options ...HttpOptions) (*stream.Stream[T], error)
- type HttpOptions
- func HttpHeader(header map[string]string) HttpOptions
- func HttpParams(params map[string]string) HttpOptions
- func HttpPayload(payload map[string]string) HttpOptions
- func HttpPayloadJson(payload interface{}) HttpOptions
- func HttpPayloadMultipart(payload map[string]string, files map[string]HttpPayloadMultipartFile) HttpOptions
- func HttpPayloadText(payload string) HttpOptions
- func HttpRaiseErrorWhenStreamDataNotMatch(raise bool) HttpOptions
- func HttpReadTimeout(timeout int64) HttpOptions
- func HttpWithDirectReferer() HttpOptions
- func HttpWithRetCode(retCode *int) HttpOptions
- func HttpWriteTimeout(timeout int64) HttpOptions
- type HttpPayloadMultipartFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAndParse ¶
func GetAndParse ¶
func GetAndParseStream ¶
func PatchAndParse ¶
func PostAndParse ¶
func PostAndParseStream ¶
func PutAndParse ¶
func PutAndParseStream ¶
func RequestAndParse ¶
Types ¶
type HttpOptions ¶
type HttpOptions struct {
Type string
Value interface{}
}
func HttpHeader ¶
func HttpHeader(header map[string]string) HttpOptions
func HttpParams ¶
func HttpParams(params map[string]string) HttpOptions
which is used for params with in url
func HttpPayload ¶
func HttpPayload(payload map[string]string) HttpOptions
which is used for POST method only
func HttpPayloadJson ¶
func HttpPayloadJson(payload interface{}) HttpOptions
which is used for POST method only
func HttpPayloadMultipart ¶
func HttpPayloadMultipart(payload map[string]string, files map[string]HttpPayloadMultipartFile) HttpOptions
which is used for POST method only payload follows the form data format, and files is a map from filename to file
func HttpPayloadText ¶
func HttpPayloadText(payload string) HttpOptions
which is used for POST method only
func HttpRaiseErrorWhenStreamDataNotMatch ¶
func HttpRaiseErrorWhenStreamDataNotMatch(raise bool) HttpOptions
func HttpWithDirectReferer ¶
func HttpWithDirectReferer() HttpOptions
func HttpWithRetCode ¶
func HttpWithRetCode(retCode *int) HttpOptions
Click to show internal directories.
Click to hide internal directories.