手動上傳圖片文件
This commit is contained in:
7
test.sh
7
test.sh
@@ -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" "創建數據集"
|
||||
|
Reference in New Issue
Block a user