I'm trying to call the Azure DevOps REST API with the HTTP DART package to get a list of projects. However, whenever I call the API, I get a 401 error with the message "Unauthorized." So far, I have tried several different header formats and regenerated my personal access token numerous times. I've attached my code below, but I wonder if my HTTP header should be in a different format?
final st = "key";
final bytes = utf8. encode (str);
final base64Str = base64. encode (bytes);
print (base64Str);
var response = await http.get (
Uri.parse('https://dev.azure.com/companyrd/_apis/projects?api-version=2.0&Authorization=Basic