I have created an Web API application.
This application I have hosted on one server.
Now I am calling a post method of that (hosted ) application using async call in another application, so If I put a debugger then I am getting an Internal Server Error when call a Web API by async.
Bellow is my code
public async void PostRequest(string name)
{
try
{
string name = "rupesh";
Uri requestUri = new Uri("http://xxxxx:2565/api/Registration/SignUp"); //replace your Url
string json = "";
json = Newtonsoft.Json.JsonConvert.SerializeObject(name);
var objClint = new System.Net.Http.HttpClient();
System.Net.Http.HttpResponseMessage respon = await objClint.PostAsync(requestUri, new StringContent(json, System.Text.Encoding.UTF8, "application/json"));
string responJsonText = await respon.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
var er = ex.Message.ToString();
}
}
Give me some solution.
Thanks

Rupesh KahanePosted Nov 15, 2016, 1:22 AM
I am new in Xamarin Development.
Very Important => if you are using any Web Service for your App then do not forget to give permissions to access Internet.
Steps:
1. Right-click on your android project and select Properties.
2. Select Android Manifest in the window that opens.
3. Check the permission that you want to require in the list of permissions i.e check the checkbox of "Internet"
Bikesh SrivastavaPosted Nov 7, 2016, 10:50 PM
Salman BegPosted Nov 7, 2016, 8:54 AM