Skip to content

GetAcsResponse gets the HttpResponse is null #402

@zhenlei520

Description

@zhenlei520
AlibabaCloudCredentialsProvider provider = new AccessKeyCredentialProvider("<your-access-key-id>", "<your-access-key-secret>");
IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou");
DefaultAcsClient client = new DefaultAcsClient(profile, provider);

var request = new AssumeRoleRequest
{
    RoleArn = "<your-role-arn>",
    RoleSessionName = "<your-role-session-name>",
    DurationSeconds = 3600
};
try
{
    var response = client.GetAcsResponse(request);
    Assert.IsNotNull(response.HttpResponse);// 这里获取到HttpResponse为Null
    Console.WriteLine(System.Text.Encoding.Default.GetString(response.HttpResponse.Content));
}
catch (ServerException e)
{
    Console.WriteLine(e);
}
catch (ClientException e)
{
    Console.WriteLine(e);
}

问题已提交Pr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions