Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Pass Model to Server using Webservices

$
0
0

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.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>