Documentation
¶
Index ¶
- func EnsureURL(urlOrPath string) string
- func IsURL(s string) bool
- func RemoveUrlScheme(fullUrl string) string
- type Request
- func NewGetReq(url string, retries int, timeoutMS int64) *Request
- func NewGetReqWithHeader(url string, header map[string]string, retries int) *Request
- func NewGetReqs(urls []string, retries int, timeoutMS int64) []*Request
- func NewPostWithHeader(url string, body []byte, header map[string]string, retries int, ...) *Request
- type Response
- type ResponseWithError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveUrlScheme ¶
Types ¶
type Request ¶
type Request struct {
Method string `json:"method"`
URL string `json:"url"`
Header map[string]string `json:"header"`
Base64Body string `json:"body,omitempty"`
Retries int `json:"retries,omitempty"`
TimeoutMS int64 `json:"timeout_ms,omitempty"`
}
func NewGetReqWithHeader ¶
func NewPostWithHeader ¶
func (*Request) BodyAsBytes ¶
type Response ¶
type Response struct {
StatusCode int `json:"status_code"`
URL string `json:"url"`
Header map[string]string `json:"header"`
Base64Body string `json:"body,omitempty"`
Ex map[string]*Response `json:"ex,omitempty"`
}
func (*Response) ParseFreeJSON ¶
func (resp *Response) ParseFreeJSON(valDec freejson.ValueDecoder) (interface{}, error)
type ResponseWithError ¶
Click to show internal directories.
Click to hide internal directories.