> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/es/web-scraper-api/features/http-context-and-job-management/headers-cookies-method.md).

# Headers, cookies y método

Web Scraper API maximiza la eficiencia de acceso al sitio web utilizando encabezados y cookies predefinidos por nuestro equipo. Si es necesario, puedes definir tus propios encabezados, cookies y el método HTTP.

## Encabezados personalizados

Si necesitas tus propios encabezados, puedes usarlos añadiendo el `context:force_headers` parámetro y estableciéndolo en `true` al enviar un trabajo de scraping. Web Scraper API enviará tus encabezados personalizados junto con el conjunto de encabezados predefinidos y luego los usará para acceder al sitio web.

#### Ejemplo de código

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

## Cookies personalizadas

Si necesitas tus propias cookies, puedes usarlas añadiendo el `context:force_cookies` parámetro y estableciéndolo en `true` al enviar un trabajo de scraping. Web Scraper API enviará tus cookies personalizadas junto con el conjunto de cookies predefinidas y luego las usará para acceder al sitio web. Si también quieres reutilizar la misma dirección IP del proxy, consulta la [sesiones de proxy](/products/es/web-scraper-api/features/localization/proxy-location.md#sessions) documentación.

#### Ejemplo de código

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

## Método HTTP

`universal` la fuente usa el `GET` método HTTP de forma predeterminada.

Si necesitas enviar datos al sitio web de destino, debes establecer el método HTTP en `POST` y proporcionar un `POST` cuerpo de la solicitud codificado en Base64.

**Ejemplo de código**

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
