Using cmd curl to debug web pages

Hi, sometimes we need to check web page status via curl cmd. I want to show you some trics to get more readable output, and pass http basic authentication.

 

// This code will show you html output of the page. It is not very helpful in most cases.
curl yourdomain.com

// In cases when the website serve different websites versions on Host header basis can be used this request.
curl -skIl --verbose --header 'Host:es.yourdomain.com' 'http://yourdomain.com'

// If website is http password protected we can use example below, where -u option provide login and pasword
curl -u user:pass -skIl --verbose --header 'Host:es.yourdomain.com' 'http://yourdomain.com'

// If some data should be passed in request items[0]=335:
curl -u user:pass --data "items%5B0%5D=335" http://yourdomain.com/api/set/{some-id}

curl -u user:pass --data "items%5B0%5D=335&items%5B0%5D=336" http://yourdomain.com/api/set/{some-id}