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

18 Replies, 1690 Views

Hey, no worries, we’ve all been there! For Curl POST give input from file, your command is close. Just add the `Content-Type` header like this:

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

If you’re still stuck, maybe share the error you’re getting? Also, [ReqBin](https://reqbin.com/) is a cool site to test curl commands online.

Messages In This Thread



Users browsing this thread: 1 Guest(s)