Documentation ¶
Overview ¶
Package httpx contains HTTP extensions
Index ¶
- func GET(ctx context.Context, URL string) ([]byte, error)
- func GETWithBaseURL(ctx context.Context, baseURL, path string) ([]byte, error)
- func POST(ctx context.Context, URL, contentType string, body []byte) ([]byte, error)
- func POSTWithBaseURL(ctx context.Context, baseURL, path, contentType string, body []byte) ([]byte, error)
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GETWithBaseURL ¶
GETWithBaseURL is like GET but with baseURL and path.
Types ¶
type Request ¶
type Request struct { // Ctx is the mandatory request context. Ctx context.Context // Method is the mandatory request method. Method string // URL is the mandatory request URL. URL string // ContentType is the optional content type. ContentType string // UserAgent is the optional user agent. UserAgent string // Body is the optional request body. Body []byte // NoFailOnError controls whether an HTTP failure causes // the Perform function to fail or not. NoFailOnError bool // SOCKS5ProxyPort is the optional SOCKS5 proxy port to use. The // default value (zero) means no proxy is used. SOCKS5ProxyPort int }
Request is an HTTP request.
Click to show internal directories.
Click to hide internal directories.