手動上傳圖片文件

This commit is contained in:
2023-06-07 14:25:04 +08:00
parent 560151a72d
commit 324d6e0d50
6 changed files with 107 additions and 9 deletions

View File

@@ -48,6 +48,13 @@ session_id=$(echo "$response" | head -n -1 | grep -o '"id": "[^"]*' | cut -d '"'
#echo "session_id: $session_id"
# 上傳圖片 (POST /api/images)
response=$(curl -X POST -H "Content-Type: multipart/form-data" -F "file=@./data/test.jpeg" -b "session_id=$session_id" -s -w "%{http_code}" http://localhost:8080/api/images)
message "$response" "上傳圖片" true
# 臨時退出
exit_service "測試結束, 全部通過, 用費時間: $(($(date +%s) - $start_time))"
# 創建數據集, 應當在cookie中攜帶session_id (POST /api/datasets)
response=$(curl -X POST -H "Content-Type: application/json" -d '{"name":"test","description":"test"}' -b "session_id=$session_id" -s -w "%{http_code}" http://localhost:8080/api/datasets)
message "$response" "創建數據集"