Skip to content

h2non/gentleman

Repository files navigation

gentleman Build Status GitHub release GoDoc Coverage Status Go Report Card

Plugin-driven, middleware-oriented library to easily 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.
  • Simple and expressive API.
  • Idiomatic built on top of net/http package.
  • Strong extensibility capabilities.
  • Control-flow capable middleware layer to manage full HTTP live cycle.
  • Built-in multiplexer with easy composition features.
  • Easy to configure and use.
  • Convenient helpers and abstractions over HTTP primitives in Go.
  • 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
multipart Create multipart forms easily. Supports files and custom fields
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.

Subpackages

Examples

See examples directory for featured use case examples.

License

MIT - Tomas Aparicio