Versions in this module Expand all Collapse all v1 v1.10.0 Jan 19, 2024 Changes in this version + const ConnectionTimeoutSeconds + const DELETE + const GET + const HEAD + const IdleConnTimeoutSeconds + const OPTION + const PATCH + const POST + const PUT + const ResponseHeaderTimeoutSeconds + const TLSHandshakeTimeoutSeconds + const USER_AGENT + func CloseResponse(resp *http.Response) + func Dir(dir string) http.FileSystem + func ErrorCode(err error) int + func ErrorMsg(err error) string + func GetAdaptiveTimeoutClient() *http.Client + func GetAdaptiveTransport(insecure bool) *http.Transport + func GetAddrPort(urlStr string) (string, int, error) + func GetClient(insecure bool, timeout time.Duration) *http.Client + func GetDefaultClient() *http.Client + func GetTimeoutClient(timeout time.Duration) *http.Client + func GetTransport(insecure bool) *http.Transport + func IsRedirectError(err error) bool + func JSONRequest(client sClient, ctx context.Context, method THttpMethod, urlStr string, ...) (http.Header, jsonutils.JSONObject, error) + func JSONRequestWithRetry(client sClient, ctx context.Context, method THttpMethod, urlStr string, ...) (http.Header, jsonutils.JSONObject, error) + func JoinPath(ep string, paths ...string) string + func MsgTmplToFmt(tmpl string) string + func ParseJSONResponse(reqBody string, resp *http.Response, err error, debug bool) (http.Header, jsonutils.JSONObject, error) + func ParseResponse(reqBody string, resp *http.Response, err error, debug bool) (http.Header, []byte, error) + func Request(client sClient, ctx context.Context, method THttpMethod, urlStr string, ...) (*http.Response, error) + func RequestWithRetry(client sClient, ctx context.Context, method THttpMethod, urlStr string, ...) (*http.Response, error) + func SetClientProxyFunc(client *http.Client, proxyFunc TransportProxyFunc) bool + type Error struct + Fields []interface{} + Id string + type FileSystem struct + func (fs FileSystem) Open(path string) (http.File, error) + type JSONClientError struct + Class string + Code int + Data Error + Details string + Request struct{ ... } + func NewJsonClientError(code int, class string, msgFmt string, params ...interface{}) *JSONClientError + func (ce *JSONClientError) ParseErrorFromJsonResponse(statusCode int, status string, body jsonutils.JSONObject) error + func (e *JSONClientError) Error() string + func (err *JSONClientError) Cause() error + type JSONClientErrorMsg struct + Error *JSONClientError + type JsonBaseRequest struct + func NewJsonRequest(method THttpMethod, url string, params interface{}) *JsonBaseRequest + func (req *JsonBaseRequest) GetHeader() http.Header + func (req *JsonBaseRequest) GetHttpMethod() THttpMethod + func (req *JsonBaseRequest) GetRequestBody() jsonutils.JSONObject + func (req *JsonBaseRequest) GetUrl() string + func (req *JsonBaseRequest) SetHeader(header http.Header) + func (req *JsonBaseRequest) SetHttpMethod(method THttpMethod) + type JsonClient struct + func NewJsonClient(client sClient) *JsonClient + func (client *JsonClient) Send(ctx context.Context, req JsonRequest, response JsonResponse, debug bool) (http.Header, jsonutils.JSONObject, error) + type JsonRequest interface + GetHeader func() http.Header + GetHttpMethod func() THttpMethod + GetRequestBody func() jsonutils.JSONObject + GetUrl func() string + SetHeader func(header http.Header) + SetHttpMethod func(method THttpMethod) + type JsonResponse interface + ParseErrorFromJsonResponse func(statusCode int, status string, body jsonutils.JSONObject) error + type THttpMethod string + type TransportProxyFunc func(*http.Request) (*url.URL, error)