Last post Apr 23, 2014 08:21 AM by Horizon_Net
Apr 23, 2014 01:37 AM|vghanitala|LINK
I am new to Web API. I have the Web API, which is already developed and hosted online. example:
http://www.Webapi.org/WeathercastsByZip/query. And it's having the login also. How can is consume this web service in my project. I have tried with adding as "Add Service Reference" and "Add web reference",
no use. I have the "API Key also. How can i consume the webservice in my project.
Any help greatly appreciated.
Thanks in advance
Apr 23, 2014 01:52 AM|romy.thomas|LINK
From server side code, you can call a web api as shown below
WebClient serviceRequest = new WebClient();
string response = serviceRequest.DownloadString(serviceurl);
Apr 23, 2014 01:56 AM|Ashim Chatterjee|LINK
Please check the following articles.
a: Creating the web service
b: Creating a proxy
C: Consuming the web service
2,Consuming a simple web service with console application using C#
Hope this helps
Apr 23, 2014 03:15 AM|l.laxmikant|LINK
You will have to use jQuery.Ajax and provide url to get or post data
you can use C# - Webclient object
Apr 23, 2014 08:21 AM|Horizon_Net|LINK
an alternative to WebClient would be the usage of HttpClient class.
This tutorial helps to get you started.