-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhttpie_curl_test_requests.txt
50 lines (35 loc) · 1.63 KB
/
httpie_curl_test_requests.txt
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
//generic get devices request
curl --request GET \
--url http://127.0.0.1:5000/devices/get \
--header 'Content-Type: application/json'
//add device with the following values:
//
// devicename=Toaster
// deviceconsumption=200
// devicestatus=on
// devicepriority=2
//
// note: the order of these aren't important so long as they are included. devicename is required.
curl --request POST \
--url 'http://127.0.0.1:5000/devices/add?devicename=Toaster&deviceconsumption=200&devicestatus=on&devicepriority=2' \
--header 'Content-Type: application/json'
//remove device named Toaster
curl --request DELETE \
--url 'http://127.0.0.1:5000/devices/remove?devicename=Toaster'
//load devices from json
//note: this overrides current devices, so do this asap. multithreading is janky so apparently this is needed. it is some esoteric code voodoo nonsense i dont have the spirit to properly fix. so have this stupid hack instead.
curl --request GET \
--url http://127.0.0.1:5000/devices/load
//update device named Toaster
//
// Usage: All update requests must include devicename as the name of the device to be edited.
// Any other values, if supplied, will overwrite those of the device object in the list.
// Any excluded values will be left as is. The below example will overwrite all possible values.
//
// devicename (required)
// deviceconsumption (optional)
// devicestatus (optional)
// devicepriority (optional)
// deviceIP (optional)
curl --request PUT \
--url 'http://127.0.0.1:5000/devices/edit?devicename=Toaster&deviceconsumption=9999&devicestatus=off&devicepriority=4&deviceIP=192.168.0.1'