MCPcopy Index your code
hub / github.com/imroc/req / SetCommonBasicAuth

Method SetCommonBasicAuth

client.go:856–859  ·  view source on GitHub ↗

SetCommonBasicAuth set the basic auth for requests fired from the client.

(username, password string)

Source from the content-addressed store, hash-verified

854// SetCommonBasicAuth set the basic auth for requests fired from
855// the client.
856func (c *Client) SetCommonBasicAuth(username, password string) *Client {
857 c.SetCommonHeader(header.Authorization, util.BasicAuthHeaderValue(username, password))
858 return c
859}
860
861// SetCommonDigestAuth sets the Digest Access auth scheme for requests fired from the client. If a server responds with
862// 401 and sends a Digest challenge in the WWW-Authenticate Header, requests will be resent with the appropriate

Callers 2

TestSetCommonBasicAuthFunction · 0.80
SetCommonBasicAuthFunction · 0.80

Calls 2

SetCommonHeaderMethod · 0.95
BasicAuthHeaderValueFunction · 0.92

Tested by 1

TestSetCommonBasicAuthFunction · 0.64