如何消费在.NET RESTful服务? [英] How to Consume a Restful Service in .NET?

查看:185
本文介绍了如何消费在.NET RESTful服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有哪些选择消耗使用.NET Framework RESTful服务?如果是WCF(使用WebChannelFactory)更preferable到HttpClient的?

What are my options to consume a RESTful service using the .Net framework? When is WCF(using the WebChannelFactory) more preferable to HttpClient?

推荐答案

Microsoft`s最新的HTTP库是这里的 https://www.nuget.org/packages/Microsoft.Net.Http ,我有一个博客帖子展示了如何使用它的这里

Microsoft`s newest HTTP library is here https://www.nuget.org/packages/Microsoft.Net.Http and I have a blog post showing how to use it here.

您绝不会想要使用WebChannelFactory对一个RESTful服务。通过WebChannelFactory产生的耦合击败REST的点

You would never want to use WebChannelFactory against a RESTful service. The coupling generated by WebChannelFactory defeats the point of REST.

这篇关于如何消费在.NET RESTful服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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