> ## 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 base URI to requests

> Set the base URI for the request.

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>;
};

Sets a single base URI for every request the connection sends, combining the host and the path prefix in one step. Use this when all your requests target the same server and share a common starting path, such as `https://api.example.com/v1`. The connection fills in the scheme, host, and port from the URI, and prepends the path part to each request. As with the path plugin, the prefix is not added twice and any trailing slash is ignored. By default it only fills in the host 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/base-uri)

## Fields

<FormField property="uri" label="URI" required diType="http-uri">
  The base address requests are sent to, for example `https://api.example.com/v1`. Its scheme, host, and port set where requests go, and its path is prepended to each request path. Trailing slashes are ignored.
</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 sends every request to `https://api.example.com/v1`, so a request for `/products` ends up at `https://api.example.com/v1/products`.

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

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