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

Method SetBasicAuth

request.go:446–448  ·  view source on GitHub ↗

SetBasicAuth set basic auth for the request.

(username, password string)

Source from the content-addressed store, hash-verified

444
445// SetBasicAuth set basic auth for the request.
446func (r *Request) SetBasicAuth(username, password string) *Request {
447 return r.SetHeader(header.Authorization, util.BasicAuthHeaderValue(username, password))
448}
449
450// SetDigestAuth sets the Digest Access auth scheme for the HTTP request. If a server responds with 401 and sends a
451// Digest challenge in the WWW-Authenticate Header, the request will be resent with the appropriate Authorization Header.

Callers 2

SetBasicAuthFunction · 0.80
TestSetBasicAuthFunction · 0.80

Calls 2

SetHeaderMethod · 0.95
BasicAuthHeaderValueFunction · 0.92

Tested by 1

TestSetBasicAuthFunction · 0.64