有时我从RAILS服务器发送Https请求时出现此错误,有时可以正常工作。 我想了解不工作的原因以及它有时如何工作。
我的代码:
require 'net/http'
require "uri"
require 'net/https'
def parse_query(classname, conditions)
url = "https://link"
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
request["X-Parse-Application-Id"] = "some data"
request["X-Parse-REST-API-Key"] = "some data"
request["Content-Type"] = "application/json"
response = http.request(request)
end
Rails版本= 4.2.1 Ruby版本= 2.2.1