commit | 11167a672f88363051c7c40ce097d00f510e0232 | [log] [tgz] |
---|---|---|
author | US\paul.hoehne <phoehne@accenturefederal.com> | Thu Dec 14 11:20:38 2017 -0500 |
committer | US\paul.hoehne <phoehne@accenturefederal.com> | Thu Dec 14 11:20:38 2017 -0500 |
tree | 6ff310500deb5a8236a87e5473f713cd2ddd057a | |
parent | 82e69677efd71f9d1d8c582458144d8f7ce695e5 [diff] |
Adding ability to execute requests when there are defects in the cert.
Golang Http Digest Authentication Client
This client implements RFC7616 HTTP Digest Access Authentication and by now the basic features should work.
// import import dac "github.com/xinsnake/go-http-digest-auth-client" // create a new digest authentication request dr := dac.NewRequest(username, password, method, uri, payload) response1, err := dr.Execute() // check error, get response // reuse the existing digest authentication request so no extra request is needed dr.UpdateRequest(username, password, method, uri, payload) response2, err := dr.Execute() // check error, get response
Or you can use it with http.Request
t := dac.NewTransport(username, password)
req, err := http.NewRequest(method, uri, payload)
if err != nil {
log.Fatalln(err)
}
resp, err := t.RoundTrip(req)
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()
fmt.Println(resp)