Showing posts from February, 2021

curl - my favourite curl uses, cheatsheet and cookbook

Curl is Like the Swiss Army Knife of Web Tools Curl can be used to test your interactive web applications that use POST, GET, and PUT. Here are some of my all time favourite curl tricks 1) Upload A File to a PHP script curl -F "file=@/var/tmp/log.out;filename=$aname" send the file contents and the filename over to your php script 2) Send JSON to a PHP script curl -X POST -H "Content-Type: application/json" -d '{"username":"Marcus Wong","hostname":"APPLE"}'