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

If you’re struggling with curl post give input from file, maybe the server expects URL-encoded data? Try:

`curl -X POST http://example.com/api --data-urlencode "$(cat data.json)"`

Or, if it’s a file, use `--data-urlencode @data.json`.

Sometimes APIs are just... special.

Messages In This Thread



Users browsing this thread: 2 Guest(s)