title: Posting data to .NET WebAPI from objective-C/cocoa
body: <p>I have a pretty basic WebAPI controller:</p>
  
  <pre><code>[HttpGet]
  public IQueryable&lt;User&gt; GetUsers()
  {
      return _users.AsQueryable();
  }
  
  [HttpPost]
  public User AddUser(User toAdd)
  {
      _userRepository.AddUser(toAdd);
  }
  </code></pre>
  
  <p>and the User object is similarly simple:</p>
  
  <pre><code>public class User
  {
      public String name { get; set; }
      public String email { get; set; }
  }
  </code></pre>
  
  <p>(obviously some of the boring parts are left out!)</p>
  
  <p>Posting to the service works fine through a C# call, jQuery call, etc. </p>
  
  <p>With javascript/jquery I'd do something like :</p>
  
  <pre><code>var user = {
      "Name" : "Persons Name",
      "Email" : "Email@Email.com"
  }
  
  var processed = JSON.stringify(user);
  
  $.ajax({
      url: url,
      data: processed,
      success: ....
      ...
  });
  </code></pre>
  
  <p>I'm trying to get it to POST from Objective-C. The GET works perfectly fine, so I know it can connect etc.</p>
  
  <p>I've tried all kinds of things to try and get it to post an object via JSON, but I'm having no luck.
  Can anyone point me in the right direction?</p>
  
  <p>Thanks!</p>