private void HandleSSEMessage(EventSource eventSource, Message m)
        {
            Debug.Log("Received message " + m);
            MessageRepresentation message = JsonUtility.FromJson <MessageRepresentation>(m.Data);

            ServerSentEvent?.Invoke(this, message);
        }
 public IEnumerator PlayCard(int gameId, int turnCounter, int cardId, int targetPlayer, Action callback, Action errorHandler)
 {
     yield return(MakeRequest(UnityWebRequest.Put(Configuration.API_URL + HttpResources.DELIMITER + HttpResources.GAMES + HttpResources.DELIMITER + gameId + HttpResources.DELIMITER + HttpResources.TURNS + HttpResources.DELIMITER + turnCounter + HttpResources.DELIMITER + HttpResources.CARDS, JsonUtility.ToJson(new CardRequest(cardId, targetPlayer))),
                              "POST",
                              null,
                              callback,
                              response =>
     {
         errorHandler?.Invoke();
         ServerSentEvent?.Invoke(this, new MessageRepresentation(response));
     }));
 }