Documentation ¶
Index ¶
- Constants
- Variables
- func FileExists(name string) bool
- func MapMerge(maps ...map[string]string) map[string]string
- func MapToString(map_ map[string]string) string
- type Headers
- type HttpClient
- func (h *HttpClient) AddHeader(key, value string)
- func (h *HttpClient) Delete(url string, params map[string]string) (*Resp, error)
- func (h *HttpClient) Get(url string, params map[string]string) (*Resp, error)
- func (h *HttpClient) Head(url string, params map[string]string) (*Resp, error)
- func (h *HttpClient) Post(url string, params map[string]string) (*Resp, error)
- func (h *HttpClient) Put(url string, params map[string]string) (*Resp, error)
- func (h *HttpClient) Request(method string, url string, headers map[string]string, body io.Reader) (*Resp, error)
- type Resp
- type Settings
Constants ¶
View Source
const ( HEADER_CONTENT_ENCODING = "Content-Encoding" VERSION = "0.0.1" DEFAULT_USERAGENT = "gomagic httpclient - " + VERSION PROXY_HTTP = "HTTP" PROXY_SOCKS4 = "SOCKS4" PROXY_SOCKS5 = "SOCKS5" PROXY_SOCKS4A = "SOCKS4A" DEFAULT_ST_CONNECTTIMEOUT = 60 DEFAULT_ST_TIMEOUT = 60 DEFAULT_ST_COOKIEJAR = true )
Variables ¶
View Source
var (
HTTPMETHOD = map[string]string{
"DELETE": "DELETE",
"HEAD": "HEAD",
"GET": "GET",
"POST": "POST",
"PUT": "PUT",
}
)
Functions ¶
func FileExists ¶
func MapToString ¶
Types ¶
type HttpClient ¶
type HttpClient struct { Headers map[string]string Settings map[string]interface{} Transport http.RoundTripper CookieJar http.CookieJar // contains filtered or unexported fields }
func CustomHttpClient ¶
func CustomHttpClient(settings Settings, headers Headers) *HttpClient
func DefaultHttpClinet ¶
func DefaultHttpClinet() *HttpClient
func (*HttpClient) AddHeader ¶
func (h *HttpClient) AddHeader(key, value string)
type Resp ¶
func (*Resp) ReadString ¶
Click to show internal directories.
Click to hide internal directories.