Directories
¶
| Path | Synopsis |
|---|---|
|
Package json adds composition friendly JSON support to HTTP clients A HTTP client request can be constructed using NewRequest which takes fluent functional args to specify the Body and Query parameters: // queryArgs can be any type that can be serialized by // github.com/google/go-querystring/query" queryArgs := struct { Foo int Hoo string }{ 42, "something" } // body can be any type that can be serialied to JSON body := struct { Hey string }{ "Hey!" } // make a HTTP request with these req, err := json.NewRequest( "GET", url, json.Query(queryArgs), json.Body(body), ) The response can then be sent using standard http.Client mechanisms.
|
Package json adds composition friendly JSON support to HTTP clients A HTTP client request can be constructed using NewRequest which takes fluent functional args to specify the Body and Query parameters: // queryArgs can be any type that can be serialized by // github.com/google/go-querystring/query" queryArgs := struct { Foo int Hoo string }{ 42, "something" } // body can be any type that can be serialied to JSON body := struct { Hey string }{ "Hey!" } // make a HTTP request with these req, err := json.NewRequest( "GET", url, json.Query(queryArgs), json.Body(body), ) The response can then be sent using standard http.Client mechanisms. |
|
Package retry implements a http.RoundTripper that retries requests This package uses a configurable ExponentialBackoff mechanism: r := retry.Transport { Backoff: backoff.NewExponentialBackoff(), ShouldRetry: /* optional custom retry check function */, Transport: /* chain transports! */, } client := http.Client{Transport: r} res, err := client.Do(http.NewRequest("GET", url, nil))
|
Package retry implements a http.RoundTripper that retries requests This package uses a configurable ExponentialBackoff mechanism: r := retry.Transport { Backoff: backoff.NewExponentialBackoff(), ShouldRetry: /* optional custom retry check function */, Transport: /* chain transports! */, } client := http.Client{Transport: r} res, err := client.Do(http.NewRequest("GET", url, nil)) |
Click to show internal directories.
Click to hide internal directories.