forked from cer/event-sourcing-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handy-curl-commands.sh
36 lines (13 loc) · 919 Bytes
/
handy-curl-commands.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
#! /bin/bash -e
# Create account 1
account1=$(curl -v --data '{"initialBalance" : 500}' -H "content-type: application/json" http://localhost:8080/accounts)
# {"accountId":"0000014ae4caf314-ae7453bbb71e0000"}
curl -v http://localhost:8081/accounts/0000014ae4caf314-ae7453bbb71e0000
# {"accountId":"0000014ae4caf314-ae7453bbb71e0000","balance":50000}
# Create account 2
account2=$(curl -v --data '{"initialBalance" : 300}' -H "content-type: application/json" http://localhost:8080/accounts)
# {"accountId":"0000014ae4cc8415-ae7453bbb71e0000"}
curl -v http://localhost:8081/accounts/0000014ae4cc8415-ae7453bbb71e0000
#
transfer=$(curl -v --data '{"amount" : 150, "fromAccountId" : "0000014ae4caf314-ae7453bbb71e0000", "toAccountId" : "0000014ae4cc8415-ae7453bbb71e0000"}' -H "content-type: application/json" http://localhost:8082/transfers)
# {"moneyTransferId":"0000014ae4cef030-ae7453bbb71e0000"}