python请求400错误

python requests 400 error

您好,我正在使用 python 请求模块。我的代码是:

import requests

payload = {'AWSAccessKeyId':'AKIAJHSXAECVML4XJT7NvVLAQ',
      'Action':'ListOrders',
      'CreatedAfter':'2015-05-31T18%3A30%3A00Z',
      'MarketplaceId':'A21TJRUUN4KGV',
      'SellerId':'A3AZITEDAVC4SLU02M7',
      'SignatureMethod':'HmacSHA256',
      'SignatureVersion':2,
      'Timestamp':'2015-06-03T10%3A13%3A48Z',
      'Version':'2013-09-01'}

response = requests.post('https://mws.amazonservices.in/Orders/2013-09-01', params=payload)

print response.status_code

这些是假凭证

我明白了: 400
我在干嘛呢?

我发现了这个名为 TEMBOO 的第三方工具,它为许多网站提供 API SDK,并且在 Python 中有一个适用于亚马逊 AWS 的 SKD,当我下载它并检查ListOrders.py 的代码我在下面找到了这些代码,清楚地表明它的预期日期采用 ISO 8601 日期格式(即 2012-01-01)。

super(ListOrdersInputSet, self)._set_input('AWSSecretKeyId', value)
def set_CreatedAfter(self, value):
"""
Set the value of the CreatedAfter input for this Choreo. ((optional, date) A date used for selecting orders created after (or at) a specified time, in ISO 8601 date format (i.e. 2012-01-01). Defaults to today's date if not provided.)