Documentation ¶
Index ¶
- Constants
- func GetClient() *xhttp.Client
- func GetInputData(r *http.Request, httpBodySize int64) interface{}
- func NewClient() *xhttp.Client
- func NewClientWithProxy(proxy *url.URL) *xhttp.Client
- func Send(options *Options) (interface{}, error)
- func SendWithClient(client *xhttp.Client, options *Options) (interface{}, error)
- type Error
- type HTTPRequest
- type HTTPResponse
- type Options
Constants ¶
View Source
const OptionResponseTypeAuto = "auto"
View Source
const OptionResponseTypeByte = "byte"
View Source
const OptionResponseTypeJson = "json"
View Source
const OptionResponseTypeResponse = "response"
View Source
const OptionResponseTypeText = "text"
View Source
const OptionTypeJson = "application/json"
View Source
const OptionTypeMultipart = "multipart/form-data"
View Source
const OptionTypeText = "text/plain"
View Source
const OptionTypeUrlencode = "application/x-www-form-urlencoded"
View Source
const OptionTypeXml = "text/xml"
Variables ¶
This section is empty.
Functions ¶
func GetInputData ¶
Types ¶
type Error ¶
type HTTPRequest ¶
type HTTPRequest interface { SetURL(baseURL string, query map[string]string) HTTPRequest SetHeaders(headers map[string]string) HTTPRequest SetBody(body []byte) HTTPRequest SetUrlencodeBody(body map[string]string) HTTPRequest SetMultipartBody(cb func(w *multipart.Writer)) HTTPRequest SetJSONBody(interface{}) HTTPRequest SetTimeout(timeout time.Duration) HTTPRequest SetOutput(out io.Writer) HTTPRequest Send() (HTTPResponse, error) SendWithClient(client *xhttp.Client) (HTTPResponse, error) SetClient(client *xhttp.Client) HTTPRequest }
func NewHTTPRequest ¶
func NewHTTPRequest(method string) HTTPRequest
type HTTPResponse ¶
Click to show internal directories.
Click to hide internal directories.