Skip to content

h2non/gentleman

Repository files navigation

gentleman Build Status GitHub release GoDoc Go Report Card

Plugin driven, middleware based library to create rich, versatile and composable HTTP clients in Go.

Note: work in progress, interface contract may change at this time.

Installation

go get -u gopkg.in/h2non/gentleman.v0

Goals

  • Plugin driven, middleware based.
  • Simple and expressive API.
  • Idiomatic built on top of Go net/http package.
  • Strong extensibility capatabilities.
  • Multiplexer based on composition.
  • Easy to configure and use.
  • Built-in HTTP convenient helpers and abstractions.
  • Dependency free.

Plugins

Name Docs API Status Description
url Easily declare URL, base URL and path values in HTTP requests
auth Declare authorization headers in your requests
body Easily define bodies based on JSON, XML, strings, buffers or streams
bodytype Define body MIME type by alias
cookies Declare and store HTTP cookies easily
compression Helpers to define enable/disable HTTP compression
headers Manage HTTP headers easily
proxy Configure HTTP proxy servers
query Easily manage query params
redirect Easily configure a custom redirect policy
timeout Easily configure the HTTP timeouts (request, dial, TLS...)
transport Define a custom HTTP transport easily
tls Configure the TLS options used by the HTTP transport

Send a PR to add your plugin to the list.

Creating plugins

TODO

API

See godoc reference for detailed API documentation.

Examples

See examples directory for featured use case examples.

License

MIT - Tomas Aparicio