Documentation
¶
Index ¶
- func CompressPage(page []byte) string
- func GetHeaders(platform string) map[string]string
- func GetProxy() (string, error)
- func GetUserAgent(platform string) string
- func GuessEncoding(content []byte) (string, error)
- func ReportProxyStatus(proxy string) error
- type HttpRequest
- type HttpResponse
- type ProxyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressPage ¶
func GetHeaders ¶
func GetUserAgent ¶
func GuessEncoding ¶
func ReportProxyStatus ¶
Types ¶
type HttpRequest ¶
type HttpRequest struct {
Url string `json:"url"`
Method string `json:"method"`
PostData string `json:"post_data"`
UseProxy bool `json:"use_proxy"`
Proxy string `json:"proxy"`
Timeout int `json:"timeout"`
MaxLen int64 `json:"max_len"`
Platform string `json:"platform"`
Retry int `json:"retry"`
Header map[string]string `json:"header"`
ValidFuncs []func(resp *HttpResponse) bool `json:"-"`
Ctx context.Context `json:"-"`
Jar http.CookieJar `json:"-"`
}
type HttpResponse ¶
type HttpResponse struct {
Url string `json:"url"`
Text string `json:"text"`
Content []byte `json:"content"`
Encoding string `json:"encoding"`
StatusCode int `json:"status_code"`
Proxy string `json:"proxy"`
RemoteAddr string `json:"remote_addr"`
Error error `json:"error"`
Ctx context.Context `json:"-"`
Jar http.CookieJar `json:"-"`
}
func Download ¶
func Download(requestInfo *HttpRequest) *HttpResponse
func DownloadUrl ¶
func DownloadUrl(url string) *HttpResponse
func DownloadUrlWithProxy ¶
func DownloadUrlWithProxy(url string) *HttpResponse
Click to show internal directories.
Click to hide internal directories.