httpClient

package
v1.20.5 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 6 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 {
	Url          string
	RequestBody  []byte
	ResponseBody []byte
	Header       http.Header
	Timeout      int64 //default time.Second * 60
	Transport    *http.Transport
	Status       string // e.g. "200 OK"
	StatusCode   int    // e.g. 200
	Err          error
	Method       string
}

func New added in v1.10.9

func New(url string) *HttpClient

func (*HttpClient) Do added in v1.10.12

func (that *HttpClient) Do(data ...[]byte) *HttpClient

func (*HttpClient) Get added in v1.10.9

func (that *HttpClient) Get(data ...[]byte) *HttpClient

func (*HttpClient) HeaderAdd added in v1.10.9

func (that *HttpClient) HeaderAdd(key string, value string) *HttpClient

Add adds the key, value pair to the header. It appends to any existing values associated with key. The key is case insensitive; it is canonicalized by [CanonicalHeaderKey].

func (*HttpClient) HeaderSet added in v1.10.17

func (that *HttpClient) HeaderSet(key string, value string) *HttpClient

Get gets the first value associated with the given key. If there are no values associated with the key, Get returns "". It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is used to canonicalize the provided key. Get assumes that all keys are stored in canonical form. To use non-canonical keys, access the map directly.

func (*HttpClient) POST

func (that *HttpClient) POST(data ...[]byte) *HttpClient

func (*HttpClient) Scan added in v1.10.11

func (that *HttpClient) Scan(v any) (err error)

func (*HttpClient) SetMethod added in v1.10.12

func (that *HttpClient) SetMethod(method string) *HttpClient

func (*HttpClient) SetTimeout added in v1.10.9

func (that *HttpClient) SetTimeout(timeout int64) *HttpClient

func (*HttpClient) SetTransport added in v1.10.9

func (that *HttpClient) SetTransport(transport *http.Transport) *HttpClient

Jump to

Keyboard shortcuts

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