Click here to Skip to main content
15,895,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello
I need to get the results of this api request http://mongol.brono.com/mongol/api.php?commandname=get_units&user=juanpablo2&pass=misoft2013&format=xml1[^] from javascript or jquery. In C # is easy with HttpWebRequest and GetResponseStream. Like

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://mongol.brono.com/mongol/api.php?commandname=get_units&format=xml1&user=juanpablo2&pass=misoft2013");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
ds.ReadXml(resStream);

But I have no idea how to do it in javascript or jquery. At least I have not been succesfull.

Please help me. Thanks in advance
Posted
Comments
Sergey Alexandrovich Kryukov 26-Mar-14 15:42pm    
Why doing it on the client side, if you already use ASP.NET? (And Javascript and jQuery are not alternatives :-)
—SA

Making HTTP requests in Javascript is a very fundamental thing. This is what Ajax is based on:
http://en.wikipedia.org/wiki/Ajax_%28programming%29[^].

Using it with jQuery is done much more convenient. Please see: https://api.jquery.com/jQuery.ajax[^].

—SA
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900