Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsKnownScheme(s string) bool
- func ExtractBody(response *http.Response) ([]byte, error)
- func ExtractCookies(response *http.Response) []http.Cookie
- func IsKnownMethod(s string) bool
- func NewDefaultResponse(code int, h http.Header, c []http.Cookie, b []byte) *defaultResponse
- func ProduceDefaultClient() *http.Client
- func StatusBelongs(status Status, code int) bool
- type Request
- type Requester
- type Response
- type Status
Constants ¶
View Source
const DefaultTimeout = time.Second * 30
Variables ¶
View Source
var DefaultHttpHeaders = map[string]string{ Header.Accept: "application/json", Header.AcceptEncoding: "gzip, deflate", Header.ContentType: "application/json; charset=UTF-8", }
View Source
var Header = &headerList{
Accept: "Accept",
AcceptEncoding: "Accept-Encoding",
AcceptLanguage: "Accept-Language",
Authorization: "Authorization",
ContentEncoding: "Content-Encoding",
ContentType: "Content-Type",
UserAgent: "User-Agent",
}
Functions ¶
func ContainsKnownScheme ¶ added in v0.0.6
func IsKnownMethod ¶ added in v0.0.11
func NewDefaultResponse ¶ added in v0.0.12
func ProduceDefaultClient ¶
func StatusBelongs ¶ added in v0.0.14
Types ¶
type Requester ¶
type Requester interface { Do(Request, []int) (Response, error) DebugLog(...string) GetEndpoint(Request) (*url.URL, error) }
func NewDefaultRequester ¶
Click to show internal directories.
Click to hide internal directories.