From a shell type the following:

curl -v -X GET ‘https://www.google.co.za’

This will use the -v flag to ensure the connection attempt returns results verbosely, and the -X is to specify the verb to be used.

You can also try using other verbs:

curl -v -X HEAD ‘https://www.google.co.za’
curl -v -X POST ‘https://www.google.co.za’

The results will usually also include the methods allowed – look for the ALLOW field.

Advertisements

One thought on “WAP: Using Curl to fetch webpages from a cli/shell

  1. Thank you for all your valuable hard work on this website. Betty takes pleasure in engaging in research and it’s really obvious why. I learn all relating to the lively way you render rewarding items on this blog and even improve contribution from the others on this concept so my princess is without a doubt starting to learn a lot of things. Take pleasure in the rest of the year. You have been doing a dazzling job.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s