I am curre开发者_开发技巧ntly on the .Net 3.5 stack (including VS2008 tooling) and will not be upgrading anytime soon. What options are available to me in order to create a restful API that will be consumed by my own web application. I see my options as:
- MVC2 (less of a choice as the team is not comfortable with it)
- WCF with HTTP toolkit. (not sure what version I should be looking at for my stack)
I need the following features:
- Authentication via cookies (I quite like the ActionFilter approach of MVC for this)
- Authorization on a resource basis (User, account, etc. Again, I like the AF approach to this)
- Everything runs under HTTPS
My uncertainty is what versions, etc do I look at for my stack and what are the arguments for and against each?
There are a few options:
- WCF
- ASP.NET MVC
- A HTTP handler (pretty low level though as you have to do all restful stuff yourself)
- OpenRasta
- WCF Web API (.NET 4.0 only afaik)
- WCF Data Services (If you are basically exposing a database as a REST service)
A few more I have found on the web but know nothing about:
- Snooze
- Siesta (Builds on top of ASP.NET MVC)
- Bistro
You can use MVC directly but keep in mind that is is not designed as a REST framework so doesn't thinks like content negotiation for you. You would have to build that yourself. Depending on what you are trying to do that might be a lot of work or it might be quite simple.
Also look at Mindtouch Dream: is a very mature Rest server and client library. Some points
- It has a very good support for async services
- can work with .net 3.5 or mono.
- the last version can also be integrated with Asp Mvc (optional, its completety independent from asp).
- its on github
(I'm not sure about if it will meet your Authentication / Authorization needs)
精彩评论