Documentation ¶
Index ¶
- type HttpClient
- func (client HttpClient) EnableCookieJar() HttpClient
- func (client HttpClient) Execute(r *http.Request) (*http.Response, []byte, error)
- func (client HttpClient) Get(url string, requestHeader map[string]string) (*http.Response, []byte, error)
- func (client HttpClient) GetJson(url string, requestHeader map[string]string, v any) error
- func (client HttpClient) Post(url string, reqBody io.Reader, requestHeader map[string]string) (*http.Response, []byte, error)
- func (client HttpClient) PostForm(url string, formData, fileData, requestHeader map[string]string) (*http.Response, []byte, error)
- func (client HttpClient) PostFormJson(url string, formData, fileData, requestHeader map[string]string, v any) error
- func (client HttpClient) PostJson(url string, reqBody io.Reader, requestHeader map[string]string, v any) error
- func (client HttpClient) SetProxyUrl(rawURL string) HttpClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpClient ¶
func (HttpClient) EnableCookieJar ¶
func (client HttpClient) EnableCookieJar() HttpClient
EnableCookieJar
Enable HttpClient Cookie management
func (HttpClient) Get ¶
func (client HttpClient) Get(url string, requestHeader map[string]string) (*http.Response, []byte, error)
Get
GET request
func (HttpClient) Post ¶
func (client HttpClient) Post(url string, reqBody io.Reader, requestHeader map[string]string) (*http.Response, []byte, error)
Post
POST request
func (HttpClient) PostForm ¶
func (client HttpClient) PostForm(url string, formData, fileData, requestHeader map[string]string) (*http.Response, []byte, error)
PostForm
POST request to send FormData data
func (HttpClient) PostFormJson ¶
func (client HttpClient) PostFormJson(url string, formData, fileData, requestHeader map[string]string, v any) error
PostFormJson
POST requests to send FormData data and serialize the response JSON data to an object
func (HttpClient) PostJson ¶
func (client HttpClient) PostJson(url string, reqBody io.Reader, requestHeader map[string]string, v any) error
PostJson
POST request and serialize the response JSON data to an object
func (HttpClient) SetProxyUrl ¶
func (client HttpClient) SetProxyUrl(rawURL string) HttpClient
SetProxyUrl
Set the URL of the HTTP request proxy
Click to show internal directories.
Click to hide internal directories.