@@ -64,7 +64,7 @@ while true do
|
|||||||
{
|
{
|
||||||
method = "POST",
|
method = "POST",
|
||||||
headers = {
|
headers = {
|
||||||
host = "ngx"
|
["Content-Type"] = "application/json"
|
||||||
},
|
},
|
||||||
body = {
|
body = {
|
||||||
cjson.encode({task_type = 1, data = files})
|
cjson.encode({task_type = 1, data = files})
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
local httpc = require("resty.http").new()
|
||||||
|
|
||||||
|
-- Single-shot requests use the `request_uri` interface.
|
||||||
|
local res, err = httpc:request_uri("http://127.0.0.1:8080/api/v1/ts/create_task", {
|
||||||
|
method = "POST",
|
||||||
|
headers = {
|
||||||
|
["Content-Type"] = "application/json",
|
||||||
|
},
|
||||||
|
body = [[
|
||||||
|
{
|
||||||
|
"created_at": "2021-08-30T11:34:25.845915",
|
||||||
|
"created_by": "quarkus_test",
|
||||||
|
"data": {
|
||||||
|
"pics": [
|
||||||
|
"23f64c00-14d3-4e8a-bc73-10bfe79cd172",
|
||||||
|
"66ea4c4f-6394-4f97-92ea-e5cde4061d05",
|
||||||
|
"4ea1df10-b3a9-4f3c-8687-7e12c029e17b"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"task_status": "PENDING",
|
||||||
|
"task_type": "UPLOAD_PICTURE",
|
||||||
|
"updated_at": "2021-08-30T11:34:25.845929",
|
||||||
|
"updated_by": "quarkus_test"
|
||||||
|
}
|
||||||
|
]]
|
||||||
|
})
|
||||||
|
|
||||||
|
ngx.say(res.status)
|
||||||
|
ngx.say(err)
|
||||||
Reference in New Issue
Block a user