Use FURL to Retrieve Website Headers

By  on  

It's important to know what headers your website and its files are communicating. For example, if your website is providing a 404 status, you're probably streaking toward your computer to fix the problem. Using the FURL library, you may retrieve website headers from the command line.

The Shell Script

furl https://davidwalsh.name

Simple and quick -- just like every shell directive.

The Sample Response

HTTP/1.1 200 OK
Date: Thu, 25 Jun 2009 01:50:50 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.6
X-Pingback: https://davidwalsh.name/xmlrpc.php
Cache-Control: max-age=1, private, must-revalidate
Expires: Thu, 25 Jun 2009 01:50:51 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8

Don't have FURL? Install it by scripting this:

sudo port install furl

How is this useful? I would use this to periodically (cron) check my website to make sure it was up. What would you use this for?

Recent Features

  • By
    9 Mind-Blowing Canvas Demos

    The <canvas> element has been a revelation for the visual experts among our ranks.  Canvas provides the means for incredible and efficient animations with the added bonus of no Flash; these developers can flash their awesome JavaScript skills instead.  Here are nine unbelievable canvas demos that...

  • By
    5 More HTML5 APIs You Didn&#8217;t Know Existed

    The HTML5 revolution has provided us some awesome JavaScript and HTML APIs.  Some are APIs we knew we've needed for years, others are cutting edge mobile and desktop helpers.  Regardless of API strength or purpose, anything to help us better do our job is a...

Incredible Demos

  • By
    Introducing MooTools HeatMap

    It's often interesting to think about where on a given element, whether it be the page, an image, or a static DIV, your users are clicking.  With that curiosity in mind, I've created HeatMap: a MooTools class that allows you to detect, load, save, and...

  • By
    WebKit-Specific Style:  -webkit-appearance

    I was recently scoping out the horrid source code of the Google homepage when I noticed the "Google Search" and "I'm Feeling Lucky" buttons had a style definition I hadn't seen before:  -webkit-appearance.  The value assigned to the style was "push-button."  They are buttons so that...

Discussion

  1. I’d use it to retrieve the X-Pingback value and if it was included, I’d send a trackback. ;-)

  2. adamnfish

    Or, if you don’t fancy installing furl for this, you can do the same with curl (a powerful and flexible utility for doing performing requests) with the -I flag:

    eg.
    curl -I http://davidwalsh.name

    (you probably have curl installed already)

    to see the headers and the full response, use the verbose flag
    curl -v http://davidwalsh.name

  3. @adamnfish: Thanks for sharing that. On a side note, “adamnfish” sounds like a wacky morning FM radio show.

  4. Not sure where sources are but the Debian package is at http://bertorello.ns0.it/debian/furl/

  5. As already mentioned,

    curl -I HOSTNAME

    Has the same functionality but without installing something extra.

  6. curl -I is good. This is another suggestion…

    lwp-request -ed “http://lindesk.com/”

  7. Marco

    another trick is:

    lynx -head http://davidwalsh.name

    lynx is a linux textual browser

  8. Dang! I should have read this sooner. I was itching to jump all over the “curl -I” suggestion. Everyone got here first!

  9. Rex

    alias furl=’curl -i -X HEAD’

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!