kadoudal
unread,Sep 5, 2010, 1:13:17 PM9/5/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Curb - Ruby libcurl Bindings
I am testing a script , and I wrote the success/failure checking as
following :
request = Curl::Easy.new("#{resource_uri}") do |curl|
curl.headers["X-TrackerToken"] = @token
curl.on_success do |response|
# doing some funny thing
end
curl.on_failure do |response, err|
print "We have failure. The response code is
#{response.response_code}\n"
print "Error is: #{err.inspect}\n"
I am testing against PostBin.org, which returns a 302 code by
default..
with this coding an error is raised ... which should not be ( it's not
a failure ..)
We have failure. The response code is 302
Error is: [Curl::Err::CurlOK, "No error"]
how should I write my code to pass this test ?