# request.post

Source: https://docs.scrappey.com/docs/request-post

> Sends a POST request using a real browser session, with all the power of request.get plus support for sending request bodies.

## Parameters

This endpoint accepts all the same parameters as [`request.get`](/docs/request-get), with one key additional parameter:

| Parameter  | Type   | Required | Description |
| ---------- | ------ | -------- | ----------- |
| `postData` | string | Yes      | The body of the POST request. Must be a string in `application/x-www-form-urlencoded` format. Example: `a=b&c=d`. To send JSON data, set the appropriate content type using `customHeaders`: `"customHeaders": { "content-type": "application/json" }` |

### Shared Parameters

Refer to [`request.get`](/docs/request-get) for detailed descriptions of shared parameters like:

* `session`
* `cookies` / `cookiejar`
* `proxy` / `proxyCountry`
* `customHeaders`
* `includeImages`
* `includeLinks`
* `requestType`
* `localStorage`

## Request

### Send a Form-Encoded Body

The default. Pass `postData` as an `application/x-www-form-urlencoded` string:

```json
{
    "cmd": "request.post",
    "url": "https://httpbin.rs/post",
    "postData": "a=b"
}
```

### Send a JSON Body

To send JSON, pass `postData` as an object and set the `content-type` header:

```json
{
    "cmd": "request.post",
    "url": "https://httpbin.org/post",
    "postData": {
        "a": "b"
    },
    "customHeaders": {
        "content-type": "application/json"
    }
}
```

## Response

```json
{
    "solution": {
        "verified": true,
        "currentUrl": "https://httpbin.rs/post",
        "statusCode": 200,
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0",
        "innerText": "{\"body_string\":\"a=b\",\"headers\":{ ... },\"json\":null,\"method\":\"POST\",\"origin\":\"223.181.110.217\",\"query\":null,\"uri\":\"/post\"}",
        "cookies": [],
        "cookieString": "",
        "response": "<html><head>...</head><body><pre> ... </pre></body></html>",
        "responseHeaders": {
            "date": "Fri, 30 May 2025 16:58:07 GMT",
            "content-type": "application/json; charset=utf-8",
            "cf-ray": "947fc6437bdfe237-MRS",
            "server": "cloudflare",
            "content-encoding": "zstd",
            "access-control-allow-origin": "https://httpbin.rs",
            "vary": "Origin",
            "cf-cache-status": "DYNAMIC",
            "report-to": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=eUhoz6vNC8yrH4zwf%2FPbaolJQUZ11kO%2BbGKyYYhw1AMo6wJBn%2BobEe%2Fy5KD6Zbz7cn%2B18Yjflsajy40MsUbANQ7AqtDdlfGgkmbwHRUGcK1WpRIw3LueBTl7zEy%2F\"}], \"group\":\"cf-nel\", \"max_age\":604800}",
            "nel": "{\"success_fraction\":0, \"report_to\":\"cf-nel\", \"max_age\":604800}",
            "alt-svc": "h3=\":443\"; ma=86400",
            "server-timing": "cfCacheStatus;desc=\"DYNAMIC\", cfL4;desc=\"?proto=TCP&rtt=195244&min_rtt=136910&rtt_var=69448&sent=29&recv=20&lost=0&retrans=0&sent_bytes=11642&recv_bytes=3211&delivery_rate=60733&cwnd=256&unsent_bytes=0&cid=a544805ada7c1328&ts=4901&x=0\"",
            "x-firefox-spdy": "h2"
        },
        "requestHeaders": {
            "host": "httpbin.rs",
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0",
            "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
            "accept-language": "en-US,en;q=0.5",
            "accept-encoding": "gzip, deflate, br, zstd",
            "content-type": "application/x-www-form-urlencoded",
            "content-length": "3",
            "referer": "https://httpbin.rs/",
            "origin": "https://httpbin.rs",
            "upgrade-insecure-requests": "1",
            "sec-fetch-dest": "document",
            "sec-fetch-mode": "navigate",
            "sec-fetch-site": "same-origin",
            "sec-fetch-user": "?1",
            "connection": "keep-alive"
        },
        "requestBody": "a=b",
        "method": "POST",
        "type": "browser"
    },
    "timeElapsed": 46276,
    "data": "success",
    "session": "67142d3a-40dd-4eda-8619-f95603f3bed7"
}
```
