title: Anonymous Interface Callback in C#
body: <p>I'm making a videogame and I need clients and server to communicate (in Unity). </p>
  
  <p>The message from the server needs to be converted to a specific type based on the request: for example, the registration process will return just a bool in case of success or not; the login process must return a lot of information in a dictionary for the user who logged in (level, experience, game progress, etc.)</p>
  
  <p>In java I used to do something like this:</p>
  
  <pre><code>net().post(url.toString(), safeUrl, new Callback&lt;String&gt;()
  {
      public void onFailure(Throwable t)
      {
          // do something to handle the failure...
      }
  
      public void onSuccess(String json)
      {
          // do something...
      }
  });
  </code></pre>
  
  <p>Basically the net().post was sending a post http request to the server, and once it was done the server was calling the correct method.</p>
  
  <p>I read that C# can't do this, but that delegates can achieve something similar, do you know how? so basically I just send to the post request a method as parameter and handle it? Also is it possible to use generic types to handle the different types of requests?</p>
  
  <p>Or Is there a better way to do this?</p>