A mouse click event and its position can be send to interact with the score. The coordinates of the click are in pixels, with top left corner of coordinate (0, 0). The data should be a position in an image previously retrieved with a get message. The score may be modified and its current version number is increased.
With http server
The POST method is used to send a mouse click event. The request must have a entity-body with the entities x and y which contains the mouse coordinates. The path of the request is serverUrl/click.
Example:
<html>
<body>
<form action="serverUrl/click" method="post">
<input type="text" name="x" value="152" />
<input type="text" name="y" value="354" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
With websocket server
Example:
var clickJsonObject = { id : 8954, method : "click", x : 152, y : 354 };
exampleSocket.send(JSON.stringify(clickJsonObject));
In case of success : a response with a code 200 (“Success”) and no response body.
With websocket server
Example: { id: "45612", status: "ERROR", "error" : "unknown object type: xxxx" }
The response is asynchronous, other messages can be received before the response.