Confirmed users
93
edits
No edit summary |
|||
| Line 190: | Line 190: | ||
{"channels":[{"channelID":"1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7","version":"42"},{"channelID":"bf08e25861c900c3ab343670eee1873d0b724eef","version":"1"}]} | {"channels":[{"channelID":"1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7","version":"42"},{"channelID":"bf08e25861c900c3ab343670eee1873d0b724eef","version":"1"}]} | ||
<h4> POST /update </h4> | |||
<p>Refresh the server from the client. | |||
Refresh the server from the client. | </p><p>This request requires a X-UserAgent-ID header. If the UserAgent attempts to POST information to the server which already has data for that X-UserAgent-ID, the server will deny the request with a 403 error. In that case, the UserAgent should request re-registration for all Channels. | ||
</p> | |||
This request requires a X-UserAgent-ID header. If the UserAgent attempts to POST information to the server which already has data for that X-UserAgent-ID, the server will deny the request with a 403 error. In that case, the UserAgent should request re-registration for all Channels. | <ol><li> Server state <b>MUST</b> be considered the canonical state, <i>unless</i> the server has NO state. | ||
</li><li> On an /update call, the server <b>MUST</b> <i>atomically</i> update its state. | |||
</li></ol> | |||
The POST body is a JSON encoded block which matches the form and structure of the GET /update/ request. | <h5> Arguments </h5> | ||
<p>The POST body is a JSON encoded block which matches the form and structure of the GET /update/ request. | |||
</p> | |||
This will return an empty object. | <h5> Returns </h5> | ||
<p>This will return an empty object. | |||
</p> | |||
<h5> Example </h5> | |||
<pre class="_fck_mw_lspace">POST http://push.m.o/update | |||
{"channels":[{"channelID":"1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7","version":"42"},{"channelID":"bf08e25861c900c3ab343670eee1873d0b724eef","version":"1"}]} | |||
</pre> | |||
<pre class="_fck_mw_lspace">--- | |||
{} | |||
</pre> | |||
==== PUT /update/<ChannelID> ==== | ==== PUT /update/<ChannelID> ==== | ||