---
sidebar_position: 10
description: How to configure an HTTP(S) retriever.
---
import { integrations } from "@site/data/integrations";
import {Mandatory, NotMandatory} from "@site/src/components/checks/checks";
export const retrieverName = 'HTTP(S)'
export const info = integrations.retrievers.find((r) => r.name === retrieverName)

# HTTP(S)

## Overview
{info.longDescription ?? info.description}

## Configure the relay proxy

To configure your relay proxy to use the {retrieverName} retriever, you need to add the following
configuration to your relay proxy configuration file:

```yaml title="goff-proxy.yaml"
# ...
retrievers:
  - kind: http
    url: https://my-feature-flag-location.com/flags.goff.yaml
# ...
```
| Field name |    Mandatory     | Type   | Default  | Description                                                                                            |
|------------|:----------------:|--------|----------|--------------------------------------------------------------------------------------------------------|
| `kind`     |  <Mandatory />   | String | **none** | **Value should be `http`**.<br/>_This field is mandatory and describes which retriever you are using._ |
| `url`      |  <Mandatory />   | String | **none** | Location to retrieve the file.                                                                         |
| `method`   |  <Mandatory />   | String | `GET`    | The HTTP Method you are using to call the HTTP endpoint.                                               |
| `body`     | <NotMandatory /> | String | **none** | The HTTP Body you are using to call the HTTP endpoint.                                                 |
| `headers`  | <NotMandatory /> | Object | **none** | The HTTP headers used when calling the HTTP endpoint (useful for authorization).                       |
| `timeout`  | <NotMandatory /> | String | `10000`  | Timeout in millisecond when calling the HTTP endpoint.                                                 |


## Configure the GO Module
To configure your GO module to use the {retrieverName} retriever, you need to add the following
configuration to your `ffclient.Config{}` object:

```go title="example.go"
err := ffclient.Init(ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &httpretriever.Retriever{
        URL:    "http://example.com/flag-config.goff.yaml",
        Timeout: 2 * time.Second,
    },
})
defer ffclient.Close()
```

| Field       |    Mandatory     | Description                                                                                               |
|-------------|:----------------:|-----------------------------------------------------------------------------------------------------------|
| __URL__     |  <Mandatory />   | Location to retrieve the file <br/> _(ex: [http://mydomain.io/flag.yaml](http://mydomain.io/flag.yaml))_. |
| __Method__  | <NotMandatory /> | the HTTP method you want to use <br/>_(default is `GET`)_.                                                |
| __Body__    | <NotMandatory /> | If you need a body to get the flags.                                                                      |
| __Header__  | <NotMandatory /> | Header you should pass while calling the endpoint _(useful for authorization)_.                           |
| __Timeout__ | <NotMandatory /> | Timeout for the HTTP call <br/>(default is 10 seconds).                                                   |
