我一直碰到这个问题,下面是我的代码,可能有的地方的信息不对,因为是公司的url等。:)
我的逻辑是这样的:
ios client向我的服务器发送注册信息,我校验完成后,会向我的一个第三方合作伙伴发送信息。
如果我不往第三方发送信息,我就不会收到这个错误。
如果我向第三方发送信息,我基本上就会收到这个错误。我测试了一下。从向第三方发送数据到接到返回response,时间并不长,就 50ms左右。应该不会超时。
我把的ngx.say 放到了向第三方发送数据的前面调用或者后面调用,都会报这个错误。
是不是 resty.http本身有什么问题呢。谢谢
local function main()
{
ngx.say(cjson.encode(re))
local http = require "resty.http"
local hc = http:new()
local url = "" href="http://www.sfdfdas.com">http://www.sfdfdas.com'
-- ngx.log(ngx.ERR, 'send url,' .. url)
local ok, code, headers, status, body = hc:request {
url = "">
timeout = 60000,
method = "GET",
headers = {["Content-Type"]="application/x-www-form-urlencoded"},
body = "",
}
}