Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ASP.NET REST Servics Calls

Posted on 2013-06-11
4
166 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 500 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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