@@ -0,0 +1,223 @@
1+# A server example with WebSockets
3+_url: [`https://websuck1t.herokuapp.com`](https://websuck1t.herokuapp.com)_
14+- Supported content types are:
18+- Example (`application/json`):
25+ "postBody": "This is the post body",
30+ "postBody": "This is another post body",
35+ "postBody": "This is the post body",
40+ "postBody": "This is another post body",
45+ "postBody": "This is the post body",
50+ "postBody": "This is another post body",
60+Retrieves a user with the given `id`.
62+#### If there is no user with the given `id`, the method returns error `404`.
66+- *id*: The id of the entity you want to query.
73+- Supported content types are:
77+- Example (`application/json`):
82+ "secondName": "Leonidovich",
89+- Example (`application/json`):
94+ "secondName": "Barovich",
101+- Example (`application/json`):
106+ "secondName": "Fooovich",
113+- Example (`application/json`):
118+ "secondName": "Quixovich",
125+## WebSocket /posts/subscribe/:token
127+You access the web socket with the web socket protocol. I. e. `https://` -> `ws://`.
129+Open a web socket from the given `token` for receiving events about new and deleted posts.
131+#### Returns error `498` if the supplied token has expired or is invalid.
136+- *token*: The token, received with the previous request.
160+#### If there is no post with the given `id`, the method returns error `404`.
164+- *id*: The id of the entity you want to query.
171+- Supported content types are:
173+ - `application/json`
175+- Example (`application/json`):
179+ "postBody": "This is the post body",
185+- Example (`application/json`):
189+ "postBody": "This is another post body",
195+- Example (`application/json`):
199+ "postBody": "This is the post body",
205+- Example (`application/json`):
209+ "postBody": "This is another post body",
215+- Example (`application/json`):
219+ "postBody": "This is the post body",