How to Use Curl POST to Give Input from a File? Need Help!

18 Replies, 1710 Views

Yo, you’re on the right track with Curl POST give input from file! Just missing the header for JSON. Here’s what I use:

```
curl -X POST -H "Content-Type: application/json" -d @data.json http://example.com/api
```

Also, if you wanna test your JSON file before sending, try [JSONLint](https://jsonlint.com/) to validate it. Super handy!

Messages In This Thread



Users browsing this thread: 1 Guest(s)