哪个更适合为我的网站构建 API:MVC 或 Ado.net 数据服务? [英] Which is better for building an API for my website: MVC or Ado.net data services?

查看:23
本文介绍了哪个更适合为我的网站构建 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.

我经历了这个文章 但还没有弄明白要使用哪个.

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?

还会帮助我决定是否了解 stackoverflow API 背后的技术是什么?

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

推荐答案

尝试 WCF Web 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.
  • RESTFul 表示友好的 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天全站免登陆