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

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

问题描述

我一直在尝试创建一个简单的原型 Web 应用程序,它使用 RestSharp 来调用 Rest API.

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/(没有完整的应用示例)

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

http://www.stum.de/2009/12/22/using-restsharp-to-consume-restful-web-services/(好像是旧的)

在进行原型设计时,我收到以下代码的错误:

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?)  *

推荐答案

我设法找到了一篇关于该主题的博客文章,该文章链接到一个实现 RestSharp 的开源项目.希望对你有所帮助.

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-ac-developer/博客文章是一个 2 部分,项目在这里:https://github.com/dkarzon/DropNet

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天全站免登陆