如何使用boto3连接到mturk沙箱

mcw*_*ard 5 mechanicalturk boto3

如何指定mTurk沙箱主机.在boto中,这是通过连接完成的,但我没有在boto3 API中看到它.

这是boto

connection = MTurkConnection(aws_access_key_id=AWS_ACCESS_KEY_ID,
                         aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
                         host='mechanicalturk.sandbox.amazonaws.com')
Run Code Online (Sandbox Code Playgroud)

来自scottlobdell

mcw*_*ard 10

我想到了

endpoint_url = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'

# Uncomment this line to use in production
# endpoint_url = 'https://mturk-requester.us-east-1.amazonaws.com'

client = boto3.client('mturk',
    endpoint_url = endpoint_url
)
Run Code Online (Sandbox Code Playgroud)