William DA SILVA
Web Developer

Today I learned you can use a file with cUrl

Written on: Dec 26, 2020 • Last update: Dec 26, 2020

cUrl at-rule

One interesting bit I've found is that you can pass a file when doing a cUrl request in your terminal. This can be made by using -d @filename.json where filename.json is the file in your current dir.

Per example:

curl localhost:2019/load \
    -X POST \
    -H "Content-Type: application/json" \
    -d @caddy.json

See https://stackoverflow.com/questions/6408904/send-request-to-curl-with-post-data-sourced-from-a-file