这是建设一个API,我的网站更好:MVC或Ado.net数据服务? [英] Which is better for building an API for my website: MVC or Ado.net data services?

查看:129
本文介绍了这是建设一个API,我的网站更好:MVC或Ado.net数据服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC建立了一个网站,现在我想建立一个API,这个网站,让用户使用这个API来实现不同的网站,网页服务,插件和浏览器扩展。

I have a website built with MVC, and now I want to build an API for this website, to let users to use this API to implement different website, web services, plugins and browser extensions.

我通过这个<一去href=\"http://weblogs.asp.net/cibrax/archive/2010/10/08/asp-net-mvc-wcf-rest-and-data-services-when-to-use-what-for-restful-services.aspx\"相对=nofollow>文章,但没有得到尚未使用哪一种。

I went through this article but didn't get yet which to use.

约我想建立的API一般信息:结果
API的用户将有一个键的用户名和密码,以便能够使用该API。结果
API将允许用户验证该数据后,将内容添加到我的数据库。结果
API将允许用户上传图片到我的服务器。结果
API需要有友好的URL。

General info about the API I want to build:
The user of the API will have a key user name and password to be able to use the API.
API will let users add content to my DB after validating this data.
API will let users upload images to my server.
API need to have friendly URLs.

哪种技术适合我的情况?

Which technology will fit in my case?

也将帮助我决定是要知道什么是背后计算器API的技术?

Also will help me decide is to know what is the technology behind stackoverflow API?

推荐答案

尝试 WCF网页API 。它得到了所有的很酷的东西创造良好的RESTful API,因此,它满足您的所有需求。

Try WCF Web Api. It has got all the cool stuff to create good RESTFul api, and it satisfies all your requirements.


  • 您将使用基本或一些自定义HTTP授权,就这么简单。

  • 您会暴露出非常基本的URL创建数据,验证并返回响应,微不足道。

  • REST风格的表示友好的URL -s。

一般的想法是,该库为您提供了从请求到其响应回到最开始的强劲处理选项。这是.NET Framework和WCF主要的HTTP API,它继续演变。

The general idea is that this library gives you strong manipulation options from the very start of request till its response back. This is the main HTTP api for .NET Framework and WCF and it continues its evolution.

这篇关于这是建设一个API,我的网站更好:MVC或Ado.net数据服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆