Skip to content

About

A zero-dependency pluggable go http client which supports Retry and Pagination interfaces

Topics

Resources

Code of conduct

Stars

4 stars

Watchers

14 watching

Forks

Repository files navigation

pinpt-logo

HTTPClient is a zero dependency client which supports pluggable retry and pagination

Setup

go get -u github.com/pinpt/httpclient

Usage

The most basic usage which mimics http.Default:

httpclient.Default.Get("https://foo.com")

Customize the client by setting Config:

config := httpclient.NewConfig()
config.Retryable = httpclient.NewBackoffRetry(time.Millisecond, time.Millisecond*50, 10*time.Second, 2)
client := httpclient.NewHTTPClient(context.Background(), config, http.DefaultClient)
resp, err := client.Get("https://foo.com")

Pluggable

The httpclient package is very customizable. You can pass in any implementation of the Client interface which http.Client implements. You can implement the Retryable and Paginator interfaces for customizing how to Retry failed requests and how to handle pagination.

License

Copyright © 2018-2019 by Pinpoint Software, Inc. MIT License. Pull requests welcome! 🙏🏻

About

A zero-dependency pluggable go http client which supports Retry and Pagination interfaces

Topics

Resources

Code of conduct

Stars

4 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages