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, 1361 Views

Dude, curl post give input from file works best when the file is properly formatted. Use `jsonlint` to validate your `data.json` first.

Also, some APIs hate the `-X POST` flag. Try just:

`curl http://example.com/api -d @data.json`

Curl defaults to POST with `-d` anyway. Weird, but true!

Messages In This Thread



Users browsing this thread: 1 Guest(s)