request with digest authentication in golang
Clone or download
Latest commit b80f4d3 Sep 26, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Commit first May 18, 2017
LICENSE Add LICENSE May 19, 2017
Makefile Fix tests Sep 26, 2017
README.md Fix typo May 18, 2017
circle.yml Fix tests Sep 26, 2017
digestRequest.go Remove dependencies for errors Sep 26, 2017
digestRequest_test.go Remove unnecessary interface May 20, 2017

README.md

go-digest-request - request with digest authentication in golang

CircleCI Coverage Status

Usage

  • When creating context, use digestRequest.ContextWithClient() for appengine.urlfetch in Google App Engine.
import (
  "fmt"
  "io/ioutil"
  "net/http"

  "github.com/delphinus/go-digest-request"
  "golang.org/x/net/context"
)

func main() {
  ctx := context.Background()
  r := digestRequest.New(ctx, "john", "hello") // username & password

  req, _ := http.NewRequest("GET", "http://example.com", nil)
  resp, _ := r.Do(req)
  defer resp.Body.Close()

  b, _ := ioutil.ReadAll(resp.Body)

  fmt.Println(string(b))
}