Timeout on Head request


Julian Keenaghan <julian.keenaghan@...>
 

Hi,

I was wondering how to put a timeout on a head request using restclient.

I'm using it like this at the minute:

RestClient.head(url, {'User-Agent' => useragent}).headers

but wondering is there any way to put a timeout on that.

I see you can create a resource and put a timeout on that but doesn't
seem to be any way to do a head request on that, is it supported?

Thanks,
Julian


Archiloque <code@...>
 

Le 16 oct. 2010 à 13:05, Julian Keenaghan a écrit :

Hi,

I was wondering how to put a timeout on a head request using restclient.

I'm using it like this at the minute:

RestClient.head(url, {'User-Agent' => useragent}).headers

but wondering is there any way to put a timeout on that.

I see you can create a resource and put a timeout on that but doesn't
seem to be any way to do a head request on that, is it supported?

Thanks,
Julian
If you want to pass parameter you need to use the Request API:

Request.execute(:method => :head, :url => url, :headers => {'User-Agent' => useragent}, :timeout => XX)

Julien