Documentation
¶
Index ¶
- Constants
- func DoUrl(urlStr, method, contentType string, headers map[string]string, ...) (*response.Response, error)
- func Get(serviceName string, path string, headers map[string]string, ...) (*response.Response, error)
- func GetUrl(url string, headers map[string]string, params map[string]any, result any) (*response.Response, error)
- func GetUrlWithTimeout(url string, headers map[string]string, params map[string]any, result any, ...) (*response.Response, error)
- func GetWithTimeout(serviceName string, path string, headers map[string]string, ...) (*response.Response, error)
- func Post(serviceName string, path string, headers map[string]string, ...) (*response.Response, error)
- func PostFile(url string, headers map[string]string, params map[string]any, ...) (*response.Response, error)
- func PostFileWithTimeout(url string, headers map[string]string, params map[string]any, ...) (*response.Response, error)
- func PostFormData(serviceName string, path string, headers map[string]string, params url.Values, ...) (*response.Response, error)
- func PostFormDataUrl(url string, headers map[string]string, params url.Values, result any) (*response.Response, error)
- func PostFormDataUrlWithTimeout(url string, headers map[string]string, params url.Values, result any, ...) (*response.Response, error)
- func PostFormDataWithTimeout(serviceName string, path string, headers map[string]string, params url.Values, ...) (*response.Response, error)
- func PostJSON(serviceName string, path string, headers map[string]string, params any, ...) (*response.Response, error)
- func PostJSONUrl(url string, headers map[string]string, params any, result any) (*response.Response, error)
- func PostJSONUrlWithTimeout(url string, headers map[string]string, params any, result any, ...) (*response.Response, error)
- func PostJSONWithTimeout(serviceName string, path string, headers map[string]string, params any, ...) (*response.Response, error)
- func PostUrl(url string, headers map[string]string, params map[string]any, result any) (*response.Response, error)
- func PostUrlWithTimeout(url string, headers map[string]string, params map[string]any, result any, ...) (*response.Response, error)
- func PostWithTimeout(serviceName string, path string, headers map[string]string, ...) (*response.Response, error)
Constants ¶
View Source
const ( HTTP_LOG_ENABLE_KEY = "server.http.log.params" // WRITE_TIMEOUT_PROPERTIES = "server.http.writeTimeout" // READ_TIMEOUT_PROPERTIES = "server.http.readTimeout" // RetryOnConnectionFailure = "server.http.retry.onConnectionFailure" // RetryEnabled = "server.http.retry.enabled" // RetryOnAllOperations = "server.http.retry.allOperations" // maxRetriesOnNextServiceInstance = "server.http.retry.maxRetriesOnNextServiceInstance" // RetryableStatusCodes = "server.http.retry.retryableStatusCodes" // RetryTimes = "server.http.retry.times" ContentTypeJson = "application/json;charset=utf-8" ContentTypeXWWWFormUrlencoded = "application/x-www-form-urlencoded;charset=utf-8" ContentTypeText = "text/plain;charset=utf-8" ContentTypehtml = "text/html;charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
func DoUrl ¶ added in v0.12.16
func DoUrl(urlStr, method, contentType string, headers map[string]string, queryParams url.Values, body []byte, result any, timeout time.Duration) (*response.Response, error)
通用请求方法
func GetUrlWithTimeout ¶ added in v0.6.12
func GetWithTimeout ¶ added in v0.6.12
func PostFileWithTimeout ¶ added in v0.6.12
func PostFormData ¶ added in v0.6.6
func PostFormDataUrl ¶ added in v0.6.6
func PostFormDataUrlWithTimeout ¶ added in v0.6.12
func PostFormDataWithTimeout ¶ added in v0.6.12
func PostJSONUrl ¶
func PostJSONUrlWithTimeout ¶ added in v0.6.12
func PostJSONWithTimeout ¶ added in v0.6.12
func PostUrl ¶
func PostUrl(url string, headers map[string]string, params map[string]any, result any) (*response.Response, error)
同PostUrlWithTimeout
func PostUrlWithTimeout ¶ added in v0.6.12
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.