如何在C#中使用REST,包括PUT,POST和DELETE? [英] How to consume REST in C# including PUT, POST and DELETE?
问题描述
我有一个需要在C#中使用的REST Web服务。我需要支持的不仅仅是GET请求。我需要REST完成的所有工作,包括GET,PUT,POST和DELETE。与此接口的最佳方式是什么?我没有看到任何HTTPRequest能够进行POST或GET以外的任何事情,除非你构建自己的标题(我不喜欢)
I have a REST webservice that I need to consume in C#. I need support for more than just GET requests though. I need everything that is done by REST including GET, PUT, POST, and DELETE. What is the best way of interfacing with this? I do not see anything for HTTPRequest to be able to do POST or anything other than GET unless you construct your own headers(which I prefer not to)
是否有一些简单的和C#中完全使用REST Web服务的轻量级方法?
Is there some easy and lightweight way to fully consume REST webservices in C#?
推荐答案
在第9频道查看WCF REST上的一系列截屏视频:
Check out the series of screencasts on WCF REST up on Channel 9:
http://channel9.msdn.com/tags / REST%20Starter%20Kit%20endpoint%20screencasts /
在名为使用HttpClient支持REST服务,这将为您提供一个很好的分步指导如何做到这一切。
There's a great one amongst those called Consuming REST services with HttpClient which should give you a nice step-by-step instruction on how to do all of this.
同时查看 WCF REST开发人员中心。
这篇关于如何在C#中使用REST,包括PUT,POST和DELETE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!