Jump to the navigation menu

POSTing data from a JSON file

When sending JSON data in a POST request, instead of writing it inline with the --data or --json option, a filename can be entered - prefixed with an @ symbol.

For example, to POST the data from a data.json file:

curl --insecure --json @data.json https://mysite.com/webhook

About me

Picture of Oliver

I'm an certified Drupal Triple Expert with 18 years of experience, a Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.