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

Yo, curl post give input from file is finicky with spaces or special chars in the JSON. Make sure your file doesn’t have trailing commas or unescaped quotes.

Alternatively, use `--data-raw` for more control:

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

If it’s still failing, paste the error here—might be a server-side thing.

Messages In This Thread



Users browsing this thread: 1 Guest(s)