0

我正在使用 boto3 在 mturk 上创建命中,并且正在使用我自定义的命中类型。

问题是有时可以成功创建命中,但大多数时候它失败并出现以下错误:botocore.exceptions.ClientError:调用 CreateHITWithHITType 操作时发生错误(505):不支持 HTTP 版本。

我使用的端点网址是https://mturk-requester.us-east-1.amazonaws.com

这是代码:

client = boto3.client(
    service_name = 'mturk',
    region_name = 'us-east-1',
    endpoint_url = 'https://mturk-requester.us-east-1.amazonaws.com',
    aws_access_key_id = self.aws_access_key_id,
    aws_secret_access_key = self.aws_secret_access_key,
)
client.create_hit_with_hit_type(
    HITTypeId = '3EAACKBRW4VD5JIOW1PV2FZNGTKNPO',
    Question = xmlstr,
    MaxAssignments  = 3,
    LifetimeInSeconds = 60*60*24*7,
    UniqueRequestToken = 'history-hit-1',
)
4

0 回答 0