如何从ASP.NET 2008应用程序调用rest API
问题描述:
我在asp.net 3.5中有一个应用程序需要使用MongoDB数据库从移动应用程序访问一些数据。我有其余的API网址。我如何访问这些api并从那里获取数据,以便我可以在我的应用程序中使用它们使用MS SQL服务器作为后端?
我是什么尝试过:
我不知道这个,所以请我帮忙
I have an application in asp.net 3.5 which needs to access some data from a mobile app using MongoDB database. I have the rest API urls. how can i access these api and fetch the data from there so that i can use them in my application which uses MS SQL server as backend?
What I have tried:
I have no idea regarding this, so please i need some help
答
在另一个问题的答案中查看客户端代码:如何在发布数据后阅读webclient响应? Webclient.uploaddata方法(字符串,字符串,字节[]) [ ^ ] ...同样的原则适用于您的ASP.Net应用...
Have a look at the client code in this answer to another question: How to read a webclient response after posting data? Webclient.uploaddata method (string, string, byte[])[^] ... Same principle applies to your ASP.Net app...