How to use curl post give input from file in a request? or What's the correct way to curl post give i

18 Replies, 1374 Views

Bro, I had the same issue last week! For curl post give input from file, you gotta make sure the JSON is valid. Run `jq . data.json` to check.

Also, some APIs expect the data as `--data-binary` instead of `-d`. Try:

`curl -X POST http://example.com/api --data-binary @data.json`

Might work better for raw JSON.

Messages In This Thread



Users browsing this thread: 1 Guest(s)