Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.NET REST Servics Calls

Posted on 2013-06-11
4
Medium Priority
?
171 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 75

Expert Comment

by:käµfm³d 👽
ID: 39238767
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
ID: 39238844
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 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 39238948
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
ID: 39250469
Thank you
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

927 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