Dude, you’re missing the headers! Here’s how I do it:
```
curl -X POST https://example.com/api \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"name": "test"}'
```
Sometimes APIs are picky about `Accept` headers too.
If you’re on Windows, watch out for quotes—use double quotes outside and escape the JSON ones.
```
curl -X POST https://example.com/api \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"name": "test"}'
```
Sometimes APIs are picky about `Accept` headers too.
If you’re on Windows, watch out for quotes—use double quotes outside and escape the JSON ones.
