RestSharp简单完整的例子 [英] RestSharp simple complete example

查看:2693
本文介绍了RestSharp简单完整的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图创建一个使用RestSharp调用REST API一个简单的原型Web应用程序。

我已经无法找到它的一个很好的例子。任何人都可以请分享,并告诉我到正确的资源吗?我已经看过之后,并没有提供什么我要找的即功能齐全的例子:

http://restsharp.org/ (不具有完全的例子应用程序)

<一个href=\"http://www.stum.de/2009/12/22/using-restsharp-to-consume-restful-web-services/\">http://www.stum.de/2009/12/22/using-restsharp-to-consume-restful-web-services/ (好像是旧)

虽然原型,我得到下面的错误低于code:

  RestResponse响应= client.Execute(请求);*无法隐式转换类型'IRestResponse'到'RestResponse。一个显式转换存在(是否缺少强制转换?)*


解决方案

我设法找到关于这个问题,哪个环节断为实现RestSharp一个开源项目博客文章。希望的给你一些帮助。

<一个href=\"http://dkdevelopment.net/2010/05/18/dropbox-api-and-restsharp-for-a-c-developer/\">http://dkdevelopment.net/2010/05/18/dropbox-api-and-restsharp-for-a-c-developer/
该博客文章是2舞伴,而该项目是在这里:
https://github.com/dkarzon/DropNet

如果你有什么不工作一个完整的示例这可能会有帮助。这是很难得到客户端如何设置,如果你不提供code上下文。

I've been trying to create a simple prototype web application that uses RestSharp to call Rest API.

I've not been able to find one good example of it. Could anyone please share and direct me to right resource please? I've already looked at following, and doesn't provide what I'm looking for i.e fully functional example:

http://restsharp.org/ (Doesn't have full application with example)

http://www.stum.de/2009/12/22/using-restsharp-to-consume-restful-web-services/ (seems to be old)

While prototyping I get the error below for code below:

RestResponse response = client.Execute(request);

*Cannot implicitly convert type 'IRestResponse' to 'RestResponse'. An explicit conversion exists (are you missing a cast?)  *

解决方案

I managed to find a blog post on the subject, which links off to an open source project that implements RestSharp. Hopefully of some help to you.

http://dkdevelopment.net/2010/05/18/dropbox-api-and-restsharp-for-a-c-developer/ The blog post is a 2 parter, and the project is here: https://github.com/dkarzon/DropNet

It might help if you had a full example of what wasn't working. It's difficult to get context on how the client was set up if you don't provide the code.

这篇关于RestSharp简单完整的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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