Compare commits
2 Commits
d8088a9ced
...
ea784b0da3
Author | SHA1 | Date | |
---|---|---|---|
ea784b0da3 | |||
a347dd81d7 |
@ -1,8 +1,26 @@
|
|||||||
USER_ID=`curl -X POST http://localhost:5287/api/Users -d '{"Email":"hej@example.com","Username":"Gamer","Password":"Gamer123!"}' --header 'Content-Type: application/json'`
|
#!/bin/sh
|
||||||
|
|
||||||
TOKEN=`curl -X POST http://localhost:5287/api/Users/login -d '{"Email":"hej@example.com","Password":"Gamer123!"}' --header 'Content-Type: application/json'`
|
RESPONSE=`curl -sSLX POST http://localhost:5287/api/Users -d '{"Email":"hej@example.com","Username":"Gamer","Password":"Gamer123!"}' -H 'Content-Type: application/json' -H 'Accept: */*' -w '\n%{http_code}' --output -`
|
||||||
|
HTTP_STATUS=`echo -n "$RESPONSE" | tail -n 1`
|
||||||
|
USER_ID=`echo "$RESPONSE" | head -n -1`
|
||||||
|
|
||||||
curl http://localhost:5287/api/Users/$USER_ID
|
echo "POST /api/Users - $HTTP_STATUS"
|
||||||
|
echo -e " User ID: $USER_ID\n"
|
||||||
|
|
||||||
curl -X DELETE http://localhost:5287/api/Users/$USER_ID
|
RESPONSE=`curl -sSLX POST http://localhost:5287/api/Users/login -d '{"Email":"hej@example.com","Password":"Gamer123!"}' -H 'Content-Type: application/json' -H 'Accept: */*' -w '\n%{http_code}' --output -`
|
||||||
|
HTTP_STATUS=`echo -n "$RESPONSE" | tail -n 1`
|
||||||
|
TOKEN=`echo "$RESPONSE" | head -n -1`
|
||||||
|
|
||||||
|
echo "POST /api/Users/login - $HTTP_STATUS"
|
||||||
|
echo -e " Received token: $TOKEN\n"
|
||||||
|
|
||||||
|
RESPONSE=`curl -sSL http://localhost:5287/api/Users/$USER_ID -w '\n%{http_code}' -H 'Accept: */*' --output -`
|
||||||
|
HTTP_STATUS=`echo -n "$RESPONSE" | tail -n 1`
|
||||||
|
USER_DATA=`echo "$RESPONSE" | head -n -1`
|
||||||
|
|
||||||
|
echo "GET /api/Users/$USER_ID - $HTTP_STATUS"
|
||||||
|
echo -e " User data: $USER_DATA\n"
|
||||||
|
|
||||||
|
HTTP_STATUS=`curl -sSLX DELETE http://localhost:5287/api/Users/$USER_ID --location-trusted -w '%{http_code}' -H "Authorization: Bearer $TOKEN" -H 'Accept: */*'`
|
||||||
|
echo "DELETE /api/Users/$USER_ID - $HTTP_STATUS"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user