需要通过WCF使用.NET 2.0框架,而不是消耗RESTful Web服务。 RESTFul服务使用java构建,仅用于POST操作。为了消耗.NET我使用的是WebClient
对象的WinForms web服务。我如何饮用使用HTTP POST RESTful Web服务在.NET 2.0
下面是示例代码
string data="some data";
string url="some uri";
WebClient request = new WebClient();
//Application throws internal server error 500 at runtime when it hits this line.
string results = request.UploadString(url, "POST", data);
有什么不对,我现在做的吗?我们非常感谢在这方面的任何帮助。
是该服务是在像“的applicationName = ABC”的纯文本格式,而不是像JSON或XML预期的数据。 – Syed 2012-04-11 10:18:32