I need to call one webservice and I need to pass one string parameter within it and get response from it. Url look like http://192.168.200.131:8085/MasterService.asmx/SignUpExistingUser where SignUpExistingUser is parameter and I need to pass it one parameter called ArgMobileNo
as string.
What I have tried so far :
try
{
using (var client = new HttpClient())
{
dynamic returnValue;
client.BaseAddress = new Uri("http://192.168.200.131:8085/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("/MasterService.asmx/SignUpExistingUser?ArgMobileNo=9898989898"); // <-- HERE GETS ERROR
response.EnsureSuccessStatusCode();
returnValue = JsonConvert.DeserializeObject<string>(((HttpResponseMessage)response).Content.ReadAsStringAsync().Result);
}
// return returnValue;
}
catch (Exception e)
{
throw (e);
}