Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

how to use postasync() with a web api on a local network?

$
0
0

I have a single user authentication asp web api running on my IIS and I can view it from any browser on any device on the same network.
Now I need to use postasync() with this URI to use register method. I have implemented the following code but it doesn't seem to give any result
var Json = JsonConvert.SerializeObject(model);
HttpContent content = new StringContent(Json);
var ur = new Uri(string.Format("(my device ip):80/gpoauth/api/Account/Register",new Guid()));
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");

        var response = await client.PostAsync(ur, content);
        return response.IsSuccessStatusCode;

Viewing all articles
Browse latest Browse all 77050

Trending Articles



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