-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurl_apis.sh
executable file
·58 lines (37 loc) · 1.42 KB
/
curl_apis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# set -xeu
PORT=8080
echo "\n\n==========================="
echo "Healthcheck"
curl -X GET http://localhost:$PORT/api/
echo "\n\n==========================="
echo "Get all drivers"
curl -X GET http://localhost:$PORT/api/drivers
echo "\n\n==========================="
echo "Create new driver"
curl -X POST \
-H "Content-Type: application/json" \
-d '{"first_name": "Moaz","last_name": "Mokhtar", "email": "moaz.mokhtar@gmail.com", "phone": "0154864354"}' \
http://localhost:$PORT/api/drivers
echo "\n\n==========================="
echo "Get all drivers"
curl -X GET http://localhost:$PORT/api/drivers
echo "\n\n==========================="
echo "Create 100 drivers"
curl -X GET http://localhost:$PORT/api/drivers/rand100/
echo "\n\n==========================="
echo "Get all drivers"
curl -X GET http://localhost:$PORT/api/drivers/
echo "\n\n==========================="
echo "Get all drivers sorted 'name'"
curl -X GET http://localhost:$PORT/api/drivers/all_by_name/
echo "\n\n==========================="
echo "Get all drivers which names are sorted by characters"
curl -X GET http://localhost:$PORT/api/drivers/all_by_char/
# Uncomment below after add valid driver_uuid
# echo "\n\n==========================="
# echo "Get a driver"
# curl http://localhost:$PORT/api/drivers/0
# echo "\n\n==========================="
# echo "Delete a driver"
# curl -X DELETE http://localhost:$PORT/api/drivers/0