Alex Young
9/5/2006 9:30:00 AM
Zouplaz wrote:
> Hello, I'm goind crazy with this piece of code
>
> response = @http.get(url, headers)
> raise "url #{url} unreachable on host #{@host}:#{@port} - code
> #{response.code}" if response.code != 200
>
>
> The exception is raised even when response.code contains 200 !!
>
> What's wrong ?
The response code isn't a number, it's a string. Try:
... if response.code != "200"
--
Alex