Hi everyone,
I am trying to pass model to server. Here is the code i have,
UserRegistration user_registration = new UserRegistration();
user_registration.UserName = t.Result.Profile["screen_name"].ToString();
user_registration.UserId = t.Result.Profile["user_id"].ToString();
try{
var request = HttpWebRequest.Create (string.Format (@"http://***/api/UserRegistration",""));
request.ContentType = "application/json";
request.Method = "POST";
request.BeginGetResponse ((ar) => {
var r = (HttpWebRequest)ar.AsyncState;
using (var response = (HttpWebResponse)r.EndGetResponse (ar)) {
var s = response.GetResponseStream ();
}
}, request);
}
catch(WebException ex){
System.Console.Out.WriteLine("WebException", ex);
}
I need to send user registration model to the server. How can i do that?
Any Ideas? Please share.