Making HEAD requests

95 views
Skip to first unread message

Spyder

unread,
Nov 7, 2009, 2:30:38 PM11/7/09
to Curb - Ruby libcurl Bindings
I was looking into Curb to replace my current rbCurl implementation
I've been using. However I couldn't find a way to make a HEAD
request. It looks like it might be unimplemented based on the
documentation.

In rbCurl I set the c.nobody=true to make this work and in PHP to make
this happen I would use curl_setopt($ch, CURLOPT_NOBODY, true);

I saw what looked like the intended implementation of this in Curb
(easy.http_head => true) but its labeled "TODO
Not yet implemented" and was just wondering if I was looking at the
right thing.

The feature is great for being able to just request the header and
check the Last-Modified or Etag without downloading the whole page.

Cheers,
Dallas


Todd Fisher

unread,
Nov 8, 2009, 9:34:54 AM11/8/09
to curb---ruby-li...@googlegroups.com
Hi Dallas,

  In the latest releases, since version 0.4+ it has been supported, see: http://github.com/taf2/curb/blob/master/ext/curb_easy.c#L1913
and for an example: 

-Todd

Dallas DeVries

unread,
Nov 8, 2009, 12:21:59 PM11/8/09
to curb---ruby-li...@googlegroups.com
Thanks Todd!  That test example was very helpful, I was going about it the wrong way.  Thanks for your contributions.
Reply all
Reply to author
Forward
0 new messages