Link to home
Start Free TrialLog in
Avatar of WorknHardr
WorknHardr

asked on

ASP.NET REST Servics Calls

I found a nice article here. The problem is no explanation for 'Calling' the service from a client.

http://www.codeproject.com/Articles/426769/Creating-a-REST-service-using-ASP-NET-Web-API?msg=4323046#xx4323046xx
Avatar of kaufmed
kaufmed
Flag of United States of America image

It's WEB API, which is styled similar (built upon?) the MVC Framework that Microsoft developed. You would use standard HTTP "conversations" to interact with the service. If you look at the comments in some of the controller snippets, you will see that some of the use a GET verb, and the corresponding URI is shown as well. For the snippet I linked, you could do something like this in the browser address bar:


...since a browser will send a GET by default. You could also use Fiddler to get a bit fancier with POSTs and PUTs, if the tutorial demonstrates those (I haven't checked).
Avatar of WorknHardr
WorknHardr

ASKER

I suppose using WebClient or HttpWebResponse like the following code snippet would be the correct consuming methodology?


using System.Net;

string url = String.Format("http://localhost/task);

WebClient serviceRequest = new WebClient();

string response = serviceRequest.DownloadString(new Uri(url));
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you