Your curl post example for JSON looks spot on! That’s exactly how I do it. For form data, you’d use `-F` instead of `-d`. Here’s how:
```bash
curl -X POST https://example.com/api -F "key=value" -F "file=@path/to/file"
```
If you’re dealing with URL-encoded form data, stick with `-d` but add the header `-H "Content-Type: application/x-www-form-urlencoded"`.
Btw, Postman is a great tool to test these requests before running them in curl.
```bash
curl -X POST https://example.com/api -F "key=value" -F "file=@path/to/file"
```
If you’re dealing with URL-encoded form data, stick with `-d` but add the header `-H "Content-Type: application/x-www-form-urlencoded"`.
Btw, Postman is a great tool to test these requests before running them in curl.
