Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Use `@` before a file name with cURL data flags

Using the -d flag with the curl command in your terminal is cool, but using curl <endpoint> -d @<file-name> is cooler.

The @ syntax allows you to pass a file as the data, and it works for the other --data-<type> commands, like --data-binary and --data-urlencode.

If you want to pass an @ in the data without this special interpretation, you can use --data-raw.