Documentation ¶
Index ¶
- Constants
- Variables
- func GetRaw(client *http.Client, requestUrl string, header http.Header, ...) (data []byte, rspHeader http.Header, httpCode int, err error)
- func GetWithUnmarshal(client *http.Client, requestUrl string, header http.Header, ...) error
- func Head(client *http.Client, requestUrl string, header http.Header, params ...int) (rspHeader http.Header, httpStatus int, err error)
- func MatchProxy(proxyType string) string
- func PostRaw(client *http.Client, requestUrl string, header http.Header, ...) (data []byte, rspHeader http.Header, httpCode int, err error)
- func PostWithUnmarshal(client *http.Client, requestUrl string, header http.Header, ...) error
- type ProxyOption
Constants ¶
View Source
const ( SOCKS5 = "socks5" HTTPS = "https" HTTP = "http" )
Variables ¶
Functions ¶
func GetRaw ¶
func GetRaw(client *http.Client, requestUrl string, header http.Header, requestBody interface{}, params ...int) (data []byte, rspHeader http.Header, httpCode int, err error)
GetRaw get http raw
func GetWithUnmarshal ¶
func GetWithUnmarshal(client *http.Client, requestUrl string, header http.Header, requestBody interface{}, resp interface{}, params ...int) error
GetWithUnmarshal do http get with unmarshal
func Head ¶
func Head(client *http.Client, requestUrl string, header http.Header, params ...int) (rspHeader http.Header, httpStatus int, err error)
Head .
func MatchProxy ¶ added in v1.0.3
func PostRaw ¶
func PostRaw(client *http.Client, requestUrl string, header http.Header, requestBody interface{}, params ...int) (data []byte, rspHeader http.Header, httpCode int, err error)
PostRaw do http post, returns bytes data, response headers, http code and function error params: []int{timeoutInMillis, retryTimes}
Types ¶
type ProxyOption ¶ added in v1.0.3
type ProxyOption struct { Host string `json:"host"` Port int `json:"port"` ProxyType string `json:"proxyType"` }
func (*ProxyOption) ProxyRawUrl ¶ added in v1.0.3
func (t *ProxyOption) ProxyRawUrl() string
Click to show internal directories.
Click to hide internal directories.