You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
513 B

2 years ago
#!/bin/bash
2 years ago
if [ "$#" -ne 3 ]; then
echo "Usage: ./test_app.sh <username> <password> <image_path>"
2 years ago
exit 1
fi
2 years ago
USERNAME="$1"
PASSWORD="$2"
IMAGE_PATH="$3"
# Signup and login the user to get the session cookie
./signup_user.sh "${USERNAME}" "${PASSWORD}"
./login_user.sh "${USERNAME}" "${PASSWORD}"
2 years ago
curl -X POST \
-H "Content-Type: multipart/form-data" \
2 years ago
-b cookies.txt \
2 years ago
-F "image=@${IMAGE_PATH}" \
-F "text=Sample Text" \
-F "blocks=Block 1" \
-F "blocks=Block 2" \
http://localhost:5000/api