forked from sockjs/sockjs-ruby
-
Notifications
You must be signed in to change notification settings - Fork 5
/
xhr.sh
executable file
·25 lines (19 loc) · 974 Bytes
/
xhr.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
#!/bin/bash
# Open the session.
curl -X POST http://localhost:8081/echo/_/session_1/xhr
# Check valid messages.
curl -X POST http://localhost:8081/echo/_/session_1/xhr_send -d '["msg 1"]'
curl -X POST http://localhost:8081/echo/_/session_1/xhr_send -d '["msg 2"]'
curl -X POST http://localhost:8081/echo/_/session_1/xhr_send -d '["msg 3", "msg 4", "msg 5"]'
# Receive the messages.
curl -X POST http://localhost:8081/echo/_/session_1/xhr
# Check invalid messages.
curl -X POST http://localhost:8081/echo/_/session_1/xhr_send -d '"msg 1"'
curl -X POST http://localhost:8081/echo/_/session_1/xhr_send -d '"msg 2"'
curl -X POST http://localhost:8081/echo/_/session_1/xhr_send -d '"msg 3", "msg 4", "msg 5"'
# Receive the messages.
curl -X POST http://localhost:8081/echo/_/session_1/xhr
# Close app.
curl -X POST http://localhost:8081/close/_/session_1/xhr
curl -X POST http://localhost:8081/close/_/session_1/xhr
curl -X POST http://localhost:8081/close/_/session_1/xhr