title: Send POST request in Unity
body: <p>I'm trying to send a POST request in Unity, but I can't do that as the function that is supposed to do that is skipped, I'm not sure why. 
  I have added logs to have an idea of what happens and "(post json) called" never appears even though the text saying that has gone past the function ((send game played): after postjson) appears in the logs.</p>
  
  <pre><code>private static void SendGamePlayed() {
      int incrementedGamePlayed = GetGamePlayed () + 1;
      EventObject anEvent = CreateEvent(EVENT_GAME_PLAYED, incrementedGamePlayed, null, null);
  
      AbcEvent aAbcEvent = new AbcEvent (bundleID, appToken, anEvent);
      string json = JsonUtility.ToJson (aAbcEvent);
  
      // test
      Debug.Log("(send game played): " + json);
  
      PostJSON (json, EVENT_ROUTE);
  
      Debug.Log ("(send game played): after postjson");
  
      SetGamePlayed (incrementedGamePlayed);
  }
  
  
  private static IEnumerator PostJSON(string jsonString, string route) {
      // test
      Debug.Log("(post json) called");
  
      string url = SERVER_URL + route;
  
      var request = new UnityWebRequest(url, "POST");
      byte[] bodyRaw = Encoding.UTF8.GetBytes(jsonString);
      request.uploadHandler = (UploadHandler) new UploadHandlerRaw(bodyRaw);
      request.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer();
      request.SetRequestHeader("Content-Type", "application/json");
  
      Debug.Log ("(post json) before sending");
      yield return request.Send();
      Debug.Log ("(post json) after sending");
  
      if (request.error != null) {
          Debug.Log("request error: " + request.error);
  
      } else {
          Debug.Log("request success: " + request.downloadHandler.text);
  
      }
  }
  </code></pre>
  
  <p>Thanks for your help!</p>