# Post Request

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

> Send a POST request with form-encoded or JSON body to a target URL, useful for submitting forms, logging in, or triggering APIs.

## Command

`"cmd": "request.post"`

## Parameters

| Parameter       | Type   | Required | Description                                                         |
| --------------- | ------ | -------- | ------------------------------------------------------------------- |
| `url`           | string | Yes      | The URL to send the POST request to.                                |
| `postData`      | string | Yes      | Data to send. Must be `application/x-www-form-urlencoded`.          |
| `customHeaders` | object | No       | Set content type to `application/json` to send raw JSON.            |

## Example

### Form Data

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.post",
    "url": "https://httpbin.rs/post",
    "postData": "a=b"
  }'
```

### JSON Data

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.post",
    "url": "https://httpbin.rs/post",
    "postData": "{\"username\": \"john\", \"password\": \"1234\"}",
    "customHeaders": {
      "content-type": "application/json"
    }
  }'
```

## Notes

* `postData` must be a string.
* If using `application/json`, the JSON must be stringified.
* You can combine this with other browser actions like cookies, headers, or click automation.

Use `request.post` when interacting with login forms, submitting data, or calling APIs that require POST payloads.
