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" http://somewebsite.com/uploadfile.php

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" http://somewebsite.com/form.php -d '{"username":"Marcus Wong","hostname":"APPLE"}'

Comments

Post a Comment

Popular posts from this blog

Microsoft Visio 2010 Premium Product Keys

Fix: The Diagnostic Service Host service failed to start due to the following error. [ solved, no kidding ]

Mercedes Benz Diesel CDI EGR Emulator Circuit Diagrams