title: Post Json Data in the API
body: <p>I'm developing WP8 app and i want to know my post method is correct or not because i'm unable to post my data in the url it produces an exception..</p>
  <p><strong>My Class</strong></p>
  <pre><code>public class Register     
      {
  
          public int id { get; set; }
          public string password_reset_hash { get; set; }
          public string temp_password { get; set; }
          public bool remember_me { get; set; }
          public string activation_hash { get; set; }
          public string ip_address { get; set; }
          public bool status { get; set; }
          public bool activated { get; set; }
          public string permissions { get; set; }
          public DateTime last_login { get; set; }
          public DateTime created_at { get; set; }
          public DateTime updated_at { get; set; }
          public string email { get; set; }
          public string password { get; set; }
          public string conformpassword { get; set; }
          public string username { get; set; }      
      }
  </code></pre>
  <p><strong>my code</strong></p>
  <pre><code> public  void btn_register_click(object sender, RoutedEventArgs e)
          {
              string url=&quot;myurl&quot;;
              Register res=new Register();// my class
              res.email = txt_email.Text;
              res.password = txt_password.Text;
              res.conformpassword = txt_conf_psswrd.Text;
              res.username = txt_username.Text;
              res.created_at = DateTime.Now;
              res.last_login = DateTime.Now;
              res.updated_at = DateTime.Now;
              res.status = true;
              
              json = JsonConvert.SerializeObject(res);
              WebClient wc = new WebClient();
              var URI = new Uri(url);  
              wc.Headers[&quot;Content-Type&quot;] = &quot;application/json&quot;;                
              wc.Headers[&quot;ACCEPT&quot;] = &quot;application/json&quot;;
              wc.UploadStringCompleted += new UploadStringCompletedEventHandler(wc_UploadStringCompleted);
              wc.UploadStringAsync(URI, &quot;POST&quot;, json);             
  
          }
  
          private void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
          {
              try
              {
                  MessageBox.Show(e.Result); 
                  //e.result fetches you the response against your POST request.         
  
              }
  
              catch (Exception exc)
              {
                  MessageBox.Show(exc.ToString()); //i'm getting error here..
              }
          }
  </code></pre>
  <p><strong>Error i am getting</strong></p>
  <p><img src="https://i.stack.imgur.com/xojmE.png" alt="enter image description here" /></p>