我收到了来自 Asana 的 401 响应。
var url = "https://app.asana.com/api/1.0/users/me";
byte[] encodedByte = System.Text.ASCIIEncoding.ASCII.GetBytes(APIKey);
APIKey = Convert.ToBase64String(encodedByte);
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(url);
wrGETURL.Headers.Add("Authorization: Basic " + APIKey);
string result;
using (StreamReader reader = new StreamReader(wrGETURL.GetResponse().GetResponseStream()))
{
result = reader.ReadToEnd();
}
return result;