|
public static async Task<string> GetAccessToken(
string url,
string appkey,
string appSecrect
)
{
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
string timestamp = Convert.ToInt64(ts.TotalSeconds).ToString();
string strEncrypt = string.Format("appKey{0}timestamp{1}", appkey, timestamp);
string signature = System.Web.HttpUtility.UrlEncode(
HmacSHA256(strEncrypt, appSecrect),
System.Text.Encoding.UTF8
);
string fullUrl = string.Format(
"{0}?appKey={1}×tamp={2}&signature={3}",
url,
appkey,
timestamp,
signature
);
return await client.GetStringAsync(fullUrl);
}
之前使用以上方法获取token ,一直正常使用,今天获取一直没响应,也没有提示报错,就卡在getresult()这里,请问是什么问题?我在本地环境也是能正常访问的
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|