liseen / lua-resty-http

Lua http client driver for the ngx_lua based on the cosocket API
188 stars 70 forks source link

request failed and returns read status line failed #37

Closed RE-Roger closed 8 years ago

RE-Roger commented 8 years ago

When I try to use local ok, code, headers, status, body = httpClient:request { url = url, timeout = 3000, scheme = 'http', method = "POST", headers = {["Content-Type"] = "application/x-www-form-urlencoded" }, body = postBody } one request returned the result that ok = nil code ='read status line failed read status line failed timeout' As the code described, I presume it happened because the server didn't response anything in 3 seconds which I set in the code. But I am not sure about it, and I can't check how the server handle my request since it's one of our clients' server. But according to the client, they did response for the request. So I come here to ask for help. Is there any demonstrations about this error? Or anyone could help me with the reason. Thanks!

RE-Roger commented 8 years ago

This is caused by my resolver setting. When I changed a faster resolver server, this problem has seldom appeared.