httpclient

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	http.Client
}

func (HttpClient) EnableCookieJar

func (client HttpClient) EnableCookieJar() HttpClient

EnableCookieJar

Enable HttpClient Cookie management

func (HttpClient) Execute

func (client HttpClient) Execute(r *http.Request) (*http.Response, []byte, error)

func (HttpClient) Get

func (client HttpClient) Get(url string, requestHeader map[string]string) (*http.Response, []byte, error)

Get

GET request

func (HttpClient) GetJson

func (client HttpClient) GetJson(url string, requestHeader map[string]string, v any) error

GetJson

GET request and serialize the response JSON data to an object

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL