lua 发送post请求

function http_post_client(url, body, timeout)
    local httpc = zhttp.new()


    timeout = timeout or 30000
    httpc:set_timeout(timeout)


    local res, err_ = httpc:request_uri(url, {
        method = "POST",
        body = body,
        headers = {
            ["Content-Type"] = "application/x-www-form-urlencoded",
        }
    })


    return res, err_
end

你可能感兴趣的:(lua 发送post请求)