Cool curl commands

Using curl to GET a page

The simplest and most common request/operation made using HTTP is to get a
URL. The URL could itself refer to a web page, an image or a file. The client
issues a GET request to the server and receives the document it asked for.
If you issue the command line

curl http://vickistan.com

you get a web page returned in your terminal window. The entire HTML document
that that URL holds.

curl -w %{time_total},%{size_download}\\n -o /dev/null http://vickistan.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 25969 100 25969 0 0 14135 0 0:00:01 0:00:01 –:–:– 25509
1.837,25969

curl –form upload=@testfile –form press=OK https://vickistan.com/wp-admin/post-new.php

If you need to pass credentials:

curl -u username:password http://URL

http://curl.haxx.se/docs/httpscripting.html

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux. Bookmark the permalink.