hi
i am new in Rest Web service.
I am developing windows phone 8 application.
I have following things
server => 'http://webchannel.co/demo/einsurer/api/rtainsurer/'
http_user' =>xxxxxxxx
http_pass => xxxxxxx
api_key => xxxxxx
http_auth=> basic
test for method : xyzmethod
parameter: lang=>'en'
http_user' =>xxxxxxxx
http_pass => xxxxxxx
api_key => xxxxxx
http_auth=> basic
test for method : xyzmethod
parameter: lang=>'en'
now i want to call this web service using Webclient or Httpwebrequest
how call this using this two class.
i already try but it give result like "Remote server not found"
i also know how to check this type API in Soup UI
please help me through or any link as possible as.
thanks

Suresh MRank #171 · 14K reputationPosted May 6, 2015, 8:16 PM EDT
WebClient request=new WebClient();
request.Headers[HttpRequestHeader.ContentType]="application/json";
var result=await request.UploadStringTaskAsync(requestUrl,requestmethod,JsonParameters);
Shailesh UkeRank #1,917 · 766 reputationPosted Apr 28, 2015, 10:37 PM EDT
WebClient client = new WebClient();
client.Headers["Accept"] = "application/json";
client.DownloadStringAsync(new Uri(uri));
client.DownloadStringCompleted += (s1, e1) =>
{
// string data = JsonConvert.DeserializeObject(e1.Result.ToString());
MessageBox.Show("A");
MessageBox.Show(e1.Result.ToString());
}
Prakash TripathiRank #72 · 25.3K reputationPosted Apr 28, 2015, 11:05 PM EDT
Below links may help.
http://blogs.msdn.com/b/wsdevsol/archive/2014/01/09/consuming-rest-services-in-your-windows-store-and-phone-applications.aspx
http://www.asp.net/web-api/overview/mobile-clients/calling-web-api-from-a-windows-phone-8-application
Pranav ShahRank #6,159 · 275 reputationPosted Apr 29, 2015, 9:31 PM EDT
your code not working. it's generate error like
"Remote sever not found" and how to set header of web service
like below
http_user' =>xxxxxxxx
http_pass => xxxxxxx
api_key => xxxxxx
http_auth=> basic
and where i set method name
method : xyzmethod
mohsin shekh17 reputationPosted May 7, 2015, 8:47 PM EDT
Suresh MRank #171 · 14K reputationPosted May 7, 2015, 9:54 PM EDT
Suresh MRank #171 · 14K reputationPosted May 19, 2015, 1:59 AM EDT