Skip to content

HTTP endpoint

The HTTP Retriever will perform an HTTP Request with your configuration to get your flags.

Example

1
2
3
4
5
6
7
8
err := ffclient.Init(ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &httpretriever.Retriever{
        URL:    "http://example.com/flag-config.yaml",
        Timeout: 2 * time.Second,
    },
})
defer ffclient.Close()

Configuration fields

To configure your HTTP endpoint:

Field Description
URL Location where to retrieve the file
(ex: http://mydomain.io/flag.yaml).
Method the HTTP method you want to use
(default is GET).
Body (optional)
If you need a body to get the flags.
Header (optional)
Header you should pass while calling the endpoint (useful for authorization).
Timeout (optional)
Timeout for the HTTP call
(default is 10 seconds).