本文整理汇总了C#中DotNetOpenAuth.OAuth.ConsumerBase.PrepareAuthorizedRequestAndSend方法的典型用法代码示例。如果您正苦于以下问题:C# ConsumerBase.PrepareAuthorizedRequestAndSend方法的具体用法?C# ConsumerBase.PrepareAuthorizedRequestAndSend怎么用?C# ConsumerBase.PrepareAuthorizedRequestAndSend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetOpenAuth.OAuth.ConsumerBase
的用法示例。
在下文中一共展示了ConsumerBase.PrepareAuthorizedRequestAndSend方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyCredentials
public static XDocument VerifyCredentials(ConsumerBase twitter, string accessToken)
{
IncomingWebResponse response = twitter.PrepareAuthorizedRequestAndSend(VerifyCredentialsEndpoint, accessToken);
return XDocument.Load(XmlReader.Create(response.GetResponseReader()));
}
示例2: GetContacts
/// <summary>
/// Gets the Gmail address book's contents.
/// </summary>
/// <param name="consumer">The Google consumer previously constructed using <see cref="CreateWebConsumer"/> or <see cref="CreateDesktopConsumer"/>.</param>
/// <param name="accessToken">The access token previously retrieved.</param>
/// <returns>An XML document returned by Google.</returns>
public static XDocument GetContacts(ConsumerBase consumer, string accessToken)
{
if (consumer == null) {
throw new ArgumentNullException("consumer");
}
var response = consumer.PrepareAuthorizedRequestAndSend(GetContactsEndpoint, accessToken);
string body = response.GetResponseReader().ReadToEnd();
XDocument result = XDocument.Parse(body);
return result;
}
示例3: GetUpdates
public static XDocument GetUpdates(ConsumerBase twitter, string accessToken)
{
IncomingWebResponse response = twitter.PrepareAuthorizedRequestAndSend(GetFriendTimelineStatusEndpoint, accessToken);
return XDocument.Load(XmlReader.Create(response.GetResponseReader()));
}
示例4: GetAuthToken
public static XDocument GetAuthToken(ConsumerBase flickr, string accessToken)
{
IncomingWebResponse response = flickr.PrepareAuthorizedRequestAndSend(ServiceDescription.AccessTokenEndpoint, accessToken);
return XDocument.Load(XmlReader.Create(response.GetResponseReader()));
}