https://github.com/delphinus/go-digest-request
request with digest authentication in golang
https://github.com/delphinus/go-digest-request
digest-authentication golang golang-library golang-package http-client
Last synced: 3 months ago
JSON representation
request with digest authentication in golang
- Host: GitHub
- URL: https://github.com/delphinus/go-digest-request
- Owner: delphinus
- License: mit
- Created: 2017-05-18T07:27:00.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-07T10:19:18.000Z (about 7 years ago)
- Last Synced: 2025-04-10T02:54:22.800Z (about 1 year ago)
- Topics: digest-authentication, golang, golang-library, golang-package, http-client
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 11
- Watchers: 2
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-digest-request - request with digest authentication in golang
[](https://circleci.com/gh/delphinus/go-digest-request)
[](https://coveralls.io/github/delphinus/go-digest-request?branch=master)
## Usage
* When creating context, use `digestRequest.ContextWithClient()` for `appengine.urlfetch` in Google App Engine.
```go
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))
}
```