Solved

ASP.NET REST Servics Calls

Posted on 2013-06-11
4
164 Views
Last Modified: 2013-06-15
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
0
Comment
Question by:WorknHardr
  • 2
  • 2
4 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
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).
0
 

Author Comment

by:WorknHardr
Comment Utility
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));
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
In code, yes you could use either of those. There is also HttpClient available, with which you can do asynchronous processing.
0
 

Author Closing Comment

by:WorknHardr
Comment Utility
Thank you
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now