Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HTTPClient variable - is the client used to make HTTP calls in loli cli. // For more information: https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779 HTTPClient = &http.Client{ Timeout: time.Duration(consts.TimeoutInSeconds) * time.Second, Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, }).DialContext, ForceAttemptHTTP2: true, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, TLSClientConfig: &tls.Config{ InsecureSkipVerify: consts.InsecureSkipVerify, }, }, } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *http.Client // HTTP Client pointer BaseURL string // HTTP Request URL ContentType string // HTTP Request Content Type }
Client struct - is an http client that is configured for API.
func (*Client) Do ¶
Do performs an http.Request and optionally parses the response body into the given interface.
func (*Client) NewRequest ¶
NewRequest returns an http.Request with information for the API. For more information: https://golang.org/pkg/net/http/
Click to show internal directories.
Click to hide internal directories.