add authorization, update task data structure (#23)
* add authorization, update task data structure * update header format
This commit is contained in:
@@ -59,14 +59,16 @@ while true do
|
||||
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)
|
||||
local res, err = httpc:request_uri(
|
||||
remote_url,
|
||||
{
|
||||
method = "POST",
|
||||
headers = {
|
||||
["Content-Type"] = "application/json"
|
||||
["Content-Type"] = "application/json",
|
||||
["Authorization"] = ngx.req.get_headers().Authorization
|
||||
},
|
||||
body = cjson.encode({task_type = 1, data = files}),
|
||||
body = cjson.encode({task_type = 1, data = {images = files}}),
|
||||
}
|
||||
)
|
||||
if 201 ~= res.status then
|
||||
|
||||
Reference in New Issue
Block a user