# Json Post Request

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

> Send structured JSON payloads using a `POST` request through a real browser session for interacting with modern APIs expecting JSON-formatted input.

## Command

`"cmd": "request.post"`

## Parameters

| Parameter | Type | Required | Description |
| --------------- | ------ | -------- | ----------------------------------------------------------- |
| `url` | string | Yes | The endpoint to send the POST request to. |
| `postData` | object | Yes | JSON object to be sent in the body of the request. |
| `customHeaders` | object | Yes | Set `content-type` to `application/json` for JSON requests. |

## Example

```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.org/post",
    "customHeaders": {
      "content-type": "application/json"
    },
    "postData": {
      "a": "b"
    }
  }'
```

## Notes

* Ensure that `content-type` is explicitly set to `application/json`.
* The `postData` value should be a valid JSON object.
* You can also include additional headers like authorization tokens or user-agents under `customHeaders`.

### Use Cases

* Authenticating to RESTful APIs
* Submitting form data in JSON format
* Posting content to webhooks or services like Zapier, Slack, etc.
