MCPcopy Create free account
hub / github.com/imroc/req / SetScheme

Method SetScheme

client.go:561–566  ·  view source on GitHub ↗

SetScheme set the default scheme for client, will be used when there is no scheme in the request URL (e.g. "github.com/imroc/req").

(scheme string)

Source from the content-addressed store, hash-verified

559// SetScheme set the default scheme for client, will be used when
560// there is no scheme in the request URL (e.g. "github.com/imroc/req").
561func (c *Client) SetScheme(scheme string) *Client {
562 if !util.IsStringEmpty(scheme) {
563 c.scheme = strings.TrimSpace(scheme)
564 }
565 return c
566}
567
568// GetLogger return the internal logger, usually used in middleware.
569func (c *Client) GetLogger() Logger {

Callers 2

TestSetSchemeFunction · 0.80
SetSchemeFunction · 0.80

Calls 1

IsStringEmptyFunction · 0.92

Tested by 1

TestSetSchemeFunction · 0.64