Hey everyone,
I’m trying to figure out how to use Curl POST give input from file, but I’m kinda stuck. I’ve got this JSON file, and I need to send its contents as the body of a POST request.
I tried something like:
`curl -X POST -d @data.json http://example.com/api`
But I’m not sure if this is the right way.
Does anyone know if this is correct? Or am I missing something? Also, do I need to add headers for JSON?
Any help would be awesome! Thanks in advance.
P.S. Sorry if this is a noob question, still getting the hang of curl. 😅
I’m trying to figure out how to use Curl POST give input from file, but I’m kinda stuck. I’ve got this JSON file, and I need to send its contents as the body of a POST request.
I tried something like:
`curl -X POST -d @data.json http://example.com/api`
But I’m not sure if this is the right way.
Does anyone know if this is correct? Or am I missing something? Also, do I need to add headers for JSON?
Any help would be awesome! Thanks in advance.
P.S. Sorry if this is a noob question, still getting the hang of curl. 😅
