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

# Headers

> Site Unblocker Headers

## Passing Headers

Headers sent through Site Unblocker will be passed directly to the target website.

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -k -v -x unblock.decodo.com:60000 \
       -U "USERNAME:PASSWORD" "https://ip.decodo.com/" \
       -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36"
       -H "X-Foo: Bar" \ 
  ```

  ```python Python theme={null}
  import requests

  proxies = {
      'http': 'http://USERNAME:PASSWORD@unblock.decodo.com:60000',
      'https': 'http://USERNAME:PASSWORD@unblock.decodo.com:60000'
  }

  headers= {
      'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36'
      'X-Foo': 'Bar',
  }

  response = requests.request(
      'GET',
      'https://ip.decodo.com/',
      verify=False,
      proxies=proxies,
      headers=headers
  )

  print(response.text)
  ```

  ```javascript Node.js theme={null}
  import fetch from 'node-fetch';
  import createHttpsProxyAgent from 'https-proxy-agent'

  const username = 'YOUR_USERNAME';
  const password = 'YOUR_PASSWORD';

  const agent = createHttpsProxyAgent(
    `http://${username}:${password}@unblock.decodo.com:60000`
  );

  process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

  const headers = {
      'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36'
      'X-Foo': 'Bar',
  }

  const response = await fetch('https://ip.decodo.com/', {
    method: 'get',
    headers: headers,
    agent: agent
  });

  console.log(await response.text());
  ```
</CodeGroup>

### Exceptions

The following headers are intercepted by Site Unblocker and are not forwarded to the target website by default:

* `host`
* `accept`
* `connection`
* `cache-control`

If you wish to pass any of these headers to the target website, prefix the key of your header with `X-SU-Custom-`:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -k -v -x unblock.decodo.com:60000 \
       -U "USERNAME:PASSWORD" "https://ip.decodo.com/" \
       -H `X-SU-Custom-Host: spoofed.website.com:8080`
       -H "X-Foo: Bar" \ 
  ```
</CodeGroup>

## Cookies

The `Cookie` header does not require any prefix and can be passed directly:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -k -v -x unblock.decodo.com:60000 \
       -U "USERNAME:PASSWORD" "https://ip.decodo.com/" \
       -H "Cookie: abc=4206969; def=1234567"
  ```

  ```python Python theme={null}
  import requests

  proxies = {
      'http': 'http://USERNAME:PASSWORD@unblock.decodo.com:60000',
      'https': 'http://USERNAME:PASSWORD@unblock.decodo.com:60000'
  }

  headers= {
      'Cookie': 'abc=4206969; def=1234567',
    	'X-SU-Force-Cookies: 1',
  }

  response = requests.request(
      'GET',
      'https://ip.decodo.com/',
      verify=False,
      proxies=proxies,
      headers=headers
  )

  print(response.text)
  ```

  ```javascript Node.js theme={null}
  import fetch from 'node-fetch';
  import createHttpsProxyAgent from 'https-proxy-agent'

  const username = 'YOUR_USERNAME';
  const password = 'YOUR_PASSWORD';

  const agent = createHttpsProxyAgent(
    `http://${username}:${password}@unblock.decodo.com:60000`
  );

  process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

  const headers = {
    'Cookie': 'abc=4206969; def=1234567',
    'X-SU-Force-Cookies: 1',
  }

  const response = await fetch('https://ip.decodo.com/', {
    method: 'get',
    headers: headers,
    agent: agent
  });

  console.log(await response.text());
  ```
</CodeGroup>

# Forcing headers

Site Unblocker uses predefined header and cookie combinations to achieve the most efficient success rates for targeted websites. This means that, sometimes, we may need to drop customer provided headers in order to improve success rates.

This behaviour, however, can be overridden by forcing headers or cookies.

<Warning>
  When forcing headers or cookies, the request will always be charged from your subscription, even if the request fails.
</Warning>

| Header               | Valid values | Description                                      |
| -------------------- | ------------ | ------------------------------------------------ |
| `X-SU-Force-Headers` | `1`          | Force all headers to be forwarded to the target. |
| `X-SU-Force-Cookies` | `1`          | Force `Cookie` to be forwarded to the target     |

***

<Columns cols={2}>
  <Card title="Support" href="https://direct.lc.chat/12092754" cta="Let's chat!">
    Need help or just want to say hello? Our support is available 24/7. \
    You can also reach us anytime via email at [support@decodo.com](mailto:support@decodo.com).
  </Card>

  <Card title="Feedback" href="mailto:feedback@decodo.com" cta="Share feedback">
    Can't find what you're looking for? Request an article! \
    Have feedback? Share your thoughts on how we can improve.
  </Card>
</Columns>
