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

18 Replies, 1695 Views

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

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

If you’re still having trouble, try using [HTTPie](https://httpie.io/)—it’s like curl but simpler for API requests.

Messages In This Thread



Users browsing this thread: 1 Guest(s)