Skip to content

jpfielding/go-http-digest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Digest Authentication

GoDoc

Simple digest auth

package main

import (
	"net/http"
    	"os"
	"github.com/jpfielding/go-http-digest/pkg/digest"
)

func main() {
    // helper to create the default-ish transport
    transport := digest.DefaultHTTPTransport()
    dt := digest.NewTransport("user", "pwd", transport)
    client := dt.NewHTTPClient()
    client.Jar, _ = cookiejar.New(nil)
    // SHA-256 requrired for mongodbgov.com
    res, _err_ := client.Get("https://cloud.mongodbgov.com/api/atlas/v1.0/groups/<proj>/clusters/<cluster-name>")
    io.Copy(os.Stdout, res.Body)
    if err != nil {
        panic(err)
    }
    defer res.Body.Close()
}

About

simple implementation of rfc7616

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published