返回空响应时,cURL似乎不调用writefuntion 在空响应上,不会调用responseHandler。 那我如何才能得到空的答复?
local cURL = require("cURL")
function responseHandler(data)
print(data)
end
local headers = {
"Accept: text/*",
"Accept-Language: en",
"Accept-Charset: iso-8859-1,*,utf-8",
"Cache-Control: no-cache"
}
local url = 'http://mydomain/path'
c = cURL.easy{
url = url
ssl_verifypeer = false,
ssl_verifyhost = false,
httpheader = headers,
writefunction = function(data)
responseHandler(data)
end
}
c:perform()