# Headers, Cookies, Method

Web Scraper API maximizes website unblocking efficiency by using headers and cookies predefined by our team. If needed, you can define your own headers, cookies, and the HTTP method.

## Custom headers

If you require the use of your own headers, you can do so by adding the `context:force_headers` parameter and setting it to `true` when submitting a scraping job. Web Scraper API will send your custom headers together with the predefined headers set and then use them to access the website.

#### Code example

```json
{
    "context": [
        {
            "key": "force_headers",
            "value": true
        },
        {
            "key": "headers",
            "value": {
                "Accept-Language": "en-US,en;q=0.5"
            }
        }
    ]
    "source": "universal",
    "url": "https://example.com",
}
```

## Custom cookies

If you require the use of your own cookies, you can do so by adding the `context:force_cookies` parameter and setting it to `true` when submitting a scraping job. Web Scraper API will send your custom cookies together with the predefined cookies set and then use them to access the website. If you  also want to reuse the same proxy IP address, check out the [proxy sessions](https://developers.oxylabs.io/scraping-solutions/web-scraper-api/localization/proxy-location#sessions) documentation.

#### Code example

```json
{
    "context": [
        {
            "key": "force_cookies",
            "value": true
        },
        {
            "key": "cookies",
            "value": [
                {
                    "key": "NID", 
                    "value": "1234567890"
                }
            ]
        },
    ],
    "source": "universal",
    "url": "https://example.com",
}
```

## HTTP Method

`universal` source uses the `GET` HTTP method by default.

If you need to post data to the target website, you must set the HTTP method to `POST` and provide a Base64-encoded `POST` request body.

**Code example**

```json
[
    {
        "key": "http_method",
        "value": "post"
    },
    {
        "key": "content",
        "value": "base64EncodedPOSTBody"
    }
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/scraping-solutions/web-scraper-api/features/http-context-and-job-management/headers-cookies-method.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
