本文整理汇总了C#中Get.setURL方法的典型用法代码示例。如果您正苦于以下问题:C# Get.setURL方法的具体用法?C# Get.setURL怎么用?C# Get.setURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Get
的用法示例。
在下文中一共展示了Get.setURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: callYouTube
private JObject callYouTube(string encURL)
{
GetResultSet getResults = null;
int retry = 0;
if (successiveCalls > 5) //throttle the calls to youtube to keep under quota
{
Thread.Sleep(5000);
successiveCalls = 0;
}
else
successiveCalls++;
Get getChero = new Get(session);
string new_encURL = encURL + "&access_token=" + accessToken;
//string new_encURL = encURL;
while (retry <= 1)
{
getChero.setURL(new_encURL);
try
{
getResults = getChero.execute();
break;
}
catch (Exception e)
{
if (retry == 1)
{
Console.WriteLine(e.Message);
return null; //call to choreo has failed with refreshed access token so return null result
}
accessToken = YTRefresh.RefreshAccessToken(session, client_id, client_secret, refreshToken);
amDB.updateYoutubeAuth(dbScope, accessToken, refreshToken);
new_encURL = encURL + "&access_token=" + accessToken;
successiveCalls++;
retry++; //try once more
}
}
string anaData = getResults.Response;
JObject o = JObject.Parse(anaData);
return o;
}