An error occurred (505) when calling the CreateHITWithHITType operation: HTTP Version Not Support

123 Views Asked by At

I'm using boto3 to create hit on mturk and I'm using my customized Hit type.

The problem is that sometimes the hit could be create successfully but most of the time it failed with the following error: botocore.exceptions.ClientError: An error occurred (505) when calling the CreateHITWithHITType operation: HTTP Version Not Supported.

The endpoint url I'm using is https://mturk-requester.us-east-1.amazonaws.com

Here's the code:

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',
)
0

There are 0 best solutions below