Hi, I advise using luasocket lib instead of curl in "bin/apisix".
Although, it's very convenient to get HTTP responses by using "io.open" and "curl".
But, I think it's not an elegant way and has some limitations. Such as can't distinguish error info between Connection refused and empty response.
So I think we can use luasocket lib and create a common function in "cli/util.lua", so that we can deal with some HTTP request better in "bin/apisix".
releated: #2718
Hi, I advise using luasocket lib instead of
curlin "bin/apisix".Although, it's very convenient to get HTTP responses by using "io.open" and "curl".
But, I think it's not an elegant way and has some limitations. Such as can't distinguish error info between
Connection refusedand empty response.So I think we can use luasocket lib and create a common function in "cli/util.lua", so that we can deal with some HTTP request better in "bin/apisix".
releated: #2718