> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add host to requests

> Add the supplied host value to the Host header, can be set to overwrite existing Host header.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Adds a host to every request the connection sends out. You give it a URI, and the connection fills in the scheme (such as `https`), the host name, and the port from that URI. Use this when the requests built elsewhere in your configuration only carry a path, and you want one place to point them all at the right server. By default it only fills the host in when one is missing, but you can switch it to overwrite the host on every request.

This documentation describes: [Schema](/schemas/http-client-plugin-configurator/add-host)

## Fields

<FormField property="host" label="Host" required diType="http-uri">
  The address whose scheme, host, and port are applied to outgoing requests, for example `https://api.example.com`. The path part is ignored here.
</FormField>

<FormField property="config.replace" label="Replace host in request">
  An on/off toggle that decides what happens when a request already has a host. Leave it off (the default) to only fill in the host when none is set. Turn it on to overwrite the existing host on every request.
</FormField>

## Sample data

This plugin changes outgoing HTTP requests on a live connection rather than transforming integration data, so there is no before/after to show. The configuration below points every request at `https://api.example.com` and only fills in the host when a request does not already have one.

| Field                   | Value                     |
| ----------------------- | ------------------------- |
| Host                    | `https://api.example.com` |
| Replace host in request | off                       |

```json Configuration theme={null}
{
  "prototype": "add-host",
  "parameters": {
    "host": "https://api.example.com",
    "config": {
      "replace": false
    }
  }
}
```
