如何让外部应用程序与您的数据库和站点进行通信?
我知道社交网站上使用的术语是“API”, 我在网上做了一些研究,这似乎是一个非常大的话题。
根据我之前的文章,我使用 asp.net 3.0 和 C# 制作了一个社交网站。这是一个小原型。
一些表格,用于保存朋友和他们的朋友以及他们的兴趣的记录。目前没有隐私限制,
我想说的是,“欢迎开发者免费下载 API,并开始为社交网络制作应用程序”。考虑应用程序提取正在使用该应用程序的朋友的朋友的兴趣。
据我了解,API 是托管我或开发人员提供的应用程序的空间。
I understand the term used all over social networking sites is "API",
I did some research on the web, and it seems to be a very big topic to cover.
As per my previous post, I have made a social networking site using asp.net 3.0 and C#. It's a small prototype.
A few tables such that the record of friends and their friends and their interest is kept. There are no privacy constraint at the moment
What I would like is to, "welcome developers please download the API for free and start making applications for the social network". Consider application extracts interests of the friends of a friends who is using the application.
From what I understand, an API is a space to host an application either provided by me or the developer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
API 是应用程序(全部或部分)功能的接口。在您的特定场景中,您可以通过允许远程 http 调用(例如通过使用 Web 服务)来公开 Web-api。
http://en.wikipedia.org/wiki/Application_programming_interface#Web_APIs
APIs are an interface to (all or some of) the functionalities of your application. In your particular scenario you can expose Web-apis by allowing remote http calls (for example by using web services).
http://en.wikipedia.org/wiki/Application_programming_interface#Web_APIs
它比“右键单击添加 API...”要复杂一些,但您有几个选择:
WCF、WCF 休息和数据服务/oData
如果您急于以最快的方式获取 API将使用 oData/Data Services,基本上可以通过网络查询数据库。 (您可以限制读/写访问权限。)
这就像为数据库创建实体框架模型并将其公开为 WCF 数据服务一样简单,然后就完成了。
http://msdn.microsoft.com/en-us/data/bb931106。 aspx
http://www.odata.org/developers/odata-sdk
It's a bit more complicated than just "Right-click add API..." but you have a few options:
WCF, WCF rest, and Data Services / oData
If you're in a desparate hurry to get an API out the quickest way will be to use oData/Data Services, you basically make your database queryable via the web. (You can restrict Read/Write access.)
It's as simple as creating an Entity Framework model for your database, and exposing that as a WCF Data Service and you're done.
http://msdn.microsoft.com/en-us/data/bb931106.aspx
http://www.odata.org/developers/odata-sdk