Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiSpec ¶
type ApiSpec interface {
// IsCrypto indicates whether the API request uses EC-crypto.
IsCrypto() bool
// SetCryptoKey adds crypto key in parameters.
SetCryptoKey(key string)
// Url returns the request URL of API.
Url() string
// Payload returns the request body of API.
Payload() Payload
// Parse parses the response body.
Parse(r io.Reader) (err error)
}
ApiSpec describes the specification of an 115 API.
type Client ¶
type Client interface {
// SetUserAgent set "User-Agent" value which is used in request header.
SetUserAgent(ua string)
// GetUserAgent returns current "User-Agent" value.
GetUserAgent() string
// ImportCookies imports cookies for specific domains.
ImportCookies(cookies map[string]string, domains ...string)
// ExportCookies exports cookies for specific URL.
ExportCookies(url string) map[string]string
// Get performs an HTTP GET request.
Get(url string, headers map[string]string) (body io.ReadCloser, err error)
// CallApi calls an API.
CallApi(spec ApiSpec) error
}
Client is the low-level client which comm
Click to show internal directories.
Click to hide internal directories.