简体   繁体   English

如何在C#中使用Yahoo REST Api

[英]How to use Yahoo REST Api in C#

I'm just trying to make an yahoo boot that send to registered user of my application an instant message. 我只是想制作一个Yahoo Boot,将即时消息发送给我的应用程序的注册用户。 I've spent some hours searching the web on how to do it but yahoo developer documentation sucks.First of all I don't know what servers I should use for authorization, log in, and messaging. 我花了几个小时在网上搜索如何做,但是yahoo开发人员文档很烂。首先,我不知道我应该使用哪些服务器进行授权,登录和消息传递。 I have a consumer key and I've tried to follow this steps but nothing works. 我有一个使用者密钥,我尝试按照以下步骤操作,但是没有任何效果。

Any advice/suggestion is welcome. 欢迎任何建议/建议。

The documentation looks to be very good, I think the issue here is that your knowledge of how REST API's work in general is a bit lacking. 该文档看起来非常好,我认为这里的问题是,您对REST API的总体工作方式的了解有些缺乏。

Let's talk about diagram #2: Get a request token using: get_request_token . 让我们谈谈图2:使用 get_request_token 获取请求令牌

get_request_token is part of an HTTP endpoint, and in their diagram they want you to pass in a handful of parameters to validate your request. get_request_token是HTTP端点的一部分,在他们的图中,他们希望您传递一些参数以验证您的请求。

  • oauth_consumer_key oauth_consumer_key
  • oauth_nonce oauth_nonce
  • oauth_signature_method oauth_signature_method
  • etc 等等

(If you need more clarification of any step you can find it in the tree view on the left hand side of the page) (如果需要任何步骤的更多说明,可以在页面左侧的树形视图中找到它)

The request URL: 请求网址:

https://api.login.yahoo.com/oauth/v2/get_request_token . https://api.login.yahoo.com/oauth/v2/get_request_token

Now at this point you can either use the HTTP GET or POST verb. 现在,您可以使用HTTP GETPOST动词。 If you decide to use GET you will need to include those above parameters as a query string. 如果决定使用GET ,则需要将上述参数作为查询字符串包括在内。

?oath_consumer_key=myConsumerKey&oauth_nonce=oathNonce etc ?oath_consumer_key=myConsumerKey&oauth_nonce=oathNonce

I will leave it to you to write the associated C# code. 我将留给您编写相关的C#代码。 You'll want to start off with the HttpWebRequest.Create() method 您首先要使用HttpWebRequest.Create()方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM