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

18 Replies, 1386 Views

Hey, your curl command for Curl POST give input from file is close! Just add the JSON header:

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

If you’re still stuck, maybe check if your JSON file has any syntax errors. [JSON Editor Online](https://jsoneditoronline.org/) is a lifesaver for that.

Messages In This Thread



Users browsing this thread: 1 Guest(s)