F11
F11

Reputation: 3806

Advantages of using Restful Services in MVC

What are restful services in mvc?what are the advantages of using REST?

I have Goggled it,but haven't got good links.Can somebody help me to understand Restful services and its implementation in MVC? I have seen/read the few related links:-

http://www.servicestack.net/

http://weblogs.asp.net/scottgu/archive/2012/02/23/asp-net-web-api-part-1.aspx

RESTful services: WCF versus ASP.NET MVC

http://msdn.microsoft.com/en-us/magazine/dd943053.aspx

Upvotes: 1

Views: 932

Answers (1)

Ming Chan
Ming Chan

Reputation: 1948

MVC does not make your application more or less restful. For the most part, rest is about the interactions between the HTTP client and server. Like in REST API URI Design Approach question, mostly the focus is on the URI design.

The more practical way of thinking or applying REST as the starting point (at least it works for me) is to think in the following ways:

1) Use only HTTP ‘GET/POST/PUT/DELETE’ as the way to model your domain ‘actions’ . Just like when you dealing with database, all your actions are mapped to CURD.

2) URI/URL is to identify resources only. Should never have any ‘actions’ in your URI.

3) The data exchanged should be in the body of the HTTP messages. Just to simplify the discussions, not getting into how to model the data itself

Two great books on rest.

Upvotes: 3

Related Questions