lib/rock_fintech/http/response.rb in rock_fintech-0.1.0 vs lib/rock_fintech/http/response.rb in rock_fintech-0.2.0
- old
+ new
@@ -34,10 +34,10 @@
arr << ["}"]
arr.join("\n")
end
def http_success?
- http_response && http_response.is_a?(Net::HTTPSuccess)
+ http_response && /^2/ =~ http_response.code.to_s
end
def http_fail?
# 而 400 错误一般都是地址不存在或者没有权限,都当成错误处理
http_response && http_response.code.to_s == '404'