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

"Struggling with curl post give input from file – any tips?"

hey guys,

i'm trying to use curl post give input from file but keep getting errors. like, i have a json file (`data.json`) and wanna send it in a POST request.

i tried:
`curl -X POST http://example.com/api -d @data.json`

but it’s not working as expected. am i missing something? headers? format?

also, does curl post give input from file differently for different content types?

any help or examples would be awesome! thanks in advance.

(ps: sorry for typos, typing on mobile lol)

Messages In This Thread
How to use curl post give input from file in a request? or What's the correct way to curl post give i - by - 13-09-2024, 03:26 PM



Users browsing this thread: 1 Guest(s)