> ## 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.

# Follow redirects

> Follow request redirects with the option to preserve headers and use location headers.

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

Makes the connection automatically follow redirect responses instead of stopping at them. When the target service answers with a redirect, the connection sends the request again to the new location and returns the final response. Use this when an API moves resources or routes requests through one or more redirects and you want the call to land on the final destination without extra handling.

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

## Fields

<FormField property="preserve_header" label="Preserve headers">
  Controls whether the headers from the original request are carried over to the redirected request. Turn this on when the new location still needs headers such as authentication; turn it off to drop them when following the redirect.
</FormField>

<FormField property="use_default_for_multiple" label="Use location header for status 300">
  Controls what happens with a "Multiple Choices" (status 300) response, which can offer several locations. Turn this on to follow the location given in the response's `Location` header instead of treating the multiple options as something you have to choose between.
</FormField>

## Sample data

This plugin changes how the connection follows redirects rather than transforming data, so there is no before/after to show. The example below follows redirects while keeping the original request headers and using the location header for status 300 responses.

| Field                              | Value |
| ---------------------------------- | ----- |
| Preserve headers                   | on    |
| Use location header for status 300 | on    |

```json Configuration theme={null}
{
  "prototype": "redirect",
  "parameters": {
    "preserve_header": true,
    "use_default_for_multiple": true
  }
}
```
