-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathclient.sh
executable file
·56 lines (32 loc) · 1.49 KB
/
client.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
#!/bin/sh
set -x -e
if [ -z "$PIQI" ]
then
PIQI="../../deps/piqi/priv/bin/piqi"
if [ ! -f "$PIQI" ]
then
PIQI="../../_build/default/lib/piqi/priv/bin/piqi"
fi
fi
curl http://localhost:8888/addressbook
$PIQI call http://localhost:8888/addressbook -p
$PIQI call http://localhost:8888/addressbook -h
$PIQI call -t json http://localhost:8888/addressbook/get-person -- 0 || true
curl -v -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data-binary '{"id" : 0}' 'http://localhost:8888/addressbook/get-person'
$PIQI call -t json http://localhost:8888/addressbook/list-people
curl -v -X POST -H 'Accept: application/json' 'http://localhost:8888/addressbook/list-people'
$PIQI call -t json http://localhost:8888/addressbook/add-person -- \
--name "J. Random Hacker" \
--id 10 \
--email "[email protected]" \
--phone [ --number "(111) 123 45 67" ] \
--phone [ \
--number "(222) 123 45 67" \
--mobile \
] || true
$PIQI call -t json http://localhost:8888/addressbook/get-person -- 10
$PIQI convert -t json person.piq
curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data-binary @person.piq.json 'http://localhost:8888/addressbook/add-person'
$PIQI call -t json http://localhost:8888/addressbook/get-person -- 0
curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data-binary '{"id" : 0}' 'http://localhost:8888/addressbook/get-person'
echo "ALL TESTS PASSED"