forked from eyehubiot/hackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCURLExamples.txt
76 lines (51 loc) · 1.98 KB
/
CURLExamples.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
51
52
53
54
55
56
57
58
59
(1) GET
curl -G -H "Accept: application/json" -H "Accept-Charset: UTF-8" -H "Authorization: Basic dGVzdDE6dGVzdDE=" -H "Content-Type: application/json;charset=UTF-8" http://config28.flexeye.com/v1/iot_Default/Xs
-------------
RESPONSE:-
-------------
{
"Xs" : [ {
"uri" : "http://config28.flexeye.com/v1/iot_Default/Xs/x_member_1",
"key" : "x_member_1"
}, {
"uri" : "http://config28.flexeye.com/v1/iot_Default/Xs/x_member_2",
"key" : "x_member_2"
} ],
"XsCursor" : {
"count" : "0",
"nextUri" : null,
"prevUri" : null
}
}
(2) POST
curl -X POST -H "Accept: application/json" -H "Accept-Charset: UTF-8" -H "Authorization: Basic dGVzdDE6dGVzdDE=" -H "Content-Type: application/json;charset=UTF-8" -d "{\"id\":\"x_member_4\",\"desc\":\"description for x_member_4\",\"xRef\":\"x_member_1\"}" http://config28.flexeye.com/v1/iot_Default/Xs
-------------
RESPONSE:-
-------------
{
"id" : "x_member_4",
"xRef" : {
"uri" : "http://config28.flexeye.com/v1/iot_Default/Xs/x_member_4/xRef"
},
"desc" : "description for x_member_4",
"uri" : "http://config28.flexeye.com/v1/iot_Default/Xs/x_member_4"
}
(3) PUT
curl -X PUT -H "Accept: application/json" -H "Accept-Charset: UTF-8" -H "Authorization: Basic dGVzdDE6dGVzdDE=" -H "Content-Type: application/json;charset=UTF-8" -d "{\"desc\":\"updating description for x_member_1 to this\"}" http://config28.flexeye.com/v1/iot_Default/Xs/x_member_1
-------------
RESPONSE:-
-------------
{
"id" : "x_member_1",
"xRef" : {
"uri" : "http://config28.flexeye.com/v1/iot_Default/Xs/x_member_4/xRef"
},
"desc" : "updating description for x_member_1 to this",
"uri" : "http://config28.flexeye.com/v1/iot_Default/Xs/x_member_1"
}
(4) DELETE
curl -X DELETE -H "Accept: application/json" -H "Accept-Charset: UTF-8" -H "Authorization: Basic dGVzdDE6dGVzdDE=" -H "Content-Type: application/json;charset=UTF-8" http://config28.flexeye.com/v1/iot_Default/Xs/x_member_1
-------------
RESPONSE:-
-------------
(empty)