Sha256: 08d8c8de36b58499bafc135eeb81c581ffbd39c750fc40c0843ffe790e735f2d

Contents?: true

Size: 1.78 KB

Versions: 28

Compression:

Stored size: 1.78 KB

Contents

# Flipper Http

HTTP adapter for use with the [Flipper Api](https://github.com/jnunemaker/flipper/blob/master/docs/api/README.md).

Given you have [mounted](https://github.com/jnunemaker/flipper/blob/master/docs/api/README.md#user-content-usage) the Flipper Api on an application, you can use the HTTP adapter to interact with Flipper just like any other adapter, and internally it will handle all the http requests for you.  This means that you can have the application exposing the API store your Flipper data, but interact with it from other Ruby apps.

Initialize the HTTP adapter with a configuration Hash.
```ruby
require 'flipper/adapters/http'

configuration = {
  url: 'http://app.com/mount-point', # required
  headers: { 'X-Custom-Header' => 'foo' },
  basic_auth_username: 'user123',
  basic_auth_password: 'password123'
  read_timeout: 5,
  open_timeout: 2,
}

adapter = Flipper::Adapters::Http.new(configuration)
flipper = Flipper.new(adapter)
```

**Required keys**:
* url: String url where [Flipper Api](https://github.com/jnunemaker/flipper/blob/master/docs/api/README.md) is mounted.

**Optional keys**:
*These will affect every request the adapter makes.  For example, send basic auth credentials with every request.*

* headers: HTTP headers.
* basic_auth_username:  Basic Auth username.
* basic_auth_password: Basic Auth password.
* read_timeout: [number in seconds](https://docs.ruby-lang.org/en/2.3.0/Net/HTTP.html#attribute-i-read_timeout).
* open_timeout: [number in seconds](https://docs.ruby-lang.org/en/2.3.0/Net/HTTP.html#attribute-i-open_timeout).
* debug_output: Set an output stream for debugging (e.g. `debug_output: $stderr`). The output stream is passed on to [Net::HTTP#set_debug_output](https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html#method-i-set_debug_output).

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
flipper-0.21.0.rc1 docs/http/README.md
flipper-0.20.4 docs/http/README.md
flipper-0.20.3 docs/http/README.md
flipper-0.20.2 docs/http/README.md
flipper-0.20.1 docs/http/README.md
flipper-0.20.0 docs/http/README.md
flipper-0.20.0.beta3 docs/http/README.md
flipper-0.20.0.beta2 docs/http/README.md
flipper-0.20.0.beta1 docs/http/README.md
flipper-0.19.1 docs/http/README.md
flipper-0.19.0 docs/http/README.md
flipper-0.18.0 docs/http/README.md
flipper-0.17.2 docs/http/README.md
flipper-0.17.1 docs/http/README.md
flipper-0.16.2 docs/http/README.md
flipper-0.16.1 docs/http/README.md
flipper-0.16.0 docs/http/README.md
flipper-0.15.0 docs/http/README.md
flipper-0.14.0 docs/http/README.md
flipper-0.13.0 docs/http/README.md