This commit is contained in:
2021-11-08 16:49:40 +08:00
parent 7a3dcf279e
commit 416d598170
+7 -2
View File
@@ -63,9 +63,14 @@ while true do
local http = require "resty.http"
local httpc = http.new()
local remote_url = string.format("%s/api/v1/ts/create_task", task_server)
ngx.log(ngx.INFO, 'remote_url -> ', remote_url)
ngx.log(ngx.INFO, 'authorization -> ', ngx.req.get_headers().Authorization)
ngx.log(ngx.INFO, 'Authorization -> ', ngx.req.get_headers().Authorization)
ngx.log(ngx.INFO, 'HtySudoerToken -> ', ngx.req.get_headers().HtySudoerToken)
local body_text = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}})
ngx.log(ngx.INFO, 'UPLOAD_PICTURE body_text ->', body_text)
local res, err = httpc:request_uri(
remote_url,
{
@@ -75,7 +80,7 @@ while true do
["Authorization"] = ngx.req.get_headers().Authorization,
["HtySudoerToken"] = ngx.req.get_headers().HtySudoerToken
},
body = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}}),
body = body_text,
}
)
if 201 ~= res.status then