I found very strange behaviour of HTTP.request call.
My code looks like this:
try
result = HTTP.request(method, url, headers, body)
catch e
something
end
Server returns error, status 501 in my case, but it could be 400, it doesn’t matter. In such case, HTTP.ExceptionRequest.StatusError is caught. That is OK.
Problem is, however, that HTTP.request internally (while code waits for response/return) calls server 5 times, only then it throws that exception.
I am solving it by calling HTTP.request with status_exception=false and then handle status error before catch block, but I still consider it quite weird behaviour.
Any comment/suggestions?
Thank you,