我在本地运行rake send_events
并在heroku上运行heroku run rake send_events
。
values = {sendSmsRequest:
{
from: "ABC",
to: "5581999999999",
msg: "msg",
callbackOption: "NONE",
id: "c_1541"
}
}
headers = {
:content_type => 'application/json',
:authorization => 'Basic xxxxxxxxxxxxxxxxxxxxxxxx',
:accept => 'application/json'
}
RestClient.post 'https://api-rest.zenvia360.com.br/services/send-sms', values.to_json, headers
日志打印 RestClient::Exceptions::OpenTimeout
感谢。
答案 0 :(得分:0)
OpenTimeout
表示rest-client尝试打开与服务器的连接超时。
您确定服务器已启动并且可以从heroku访问吗?我无法通过计算机或我尝试过的任何服务器访问它。
$ nc -w 10 -v api-rest.zenvia360.com.br 443
nc: connect to api-rest.zenvia360.com.br port 443 (tcp) timed out