将数据发布到 cloudsearch 期间出现 403
403 during posting data to cloudsearch
代码如下:
import requests
url = 'document_url/documents/batch'
payload = "[{...}, {....}]"
headers = {'Content-type': 'application/json'}
response = requests.post(url, headers=headers, data=payload)
print('response code:', response.status_code)
print('response body:', response.json())
以下产量:
response code: 403
response body: {'message': 'Request forbidden by administrative rules', '__type': 'CloudSearchException'}
安全规则也对所有人开放
可能是什么问题?
根据讨论论坛:https://forums.aws.amazon.com/thread.jspa?threadID=148917
文档 url 应该是:
document_url/2013-01-01/documents/batch
在上面发帖后的回复url:
{
"status": "success",
"adds": 1,
"deletes": 0
}
代码如下:
import requests
url = 'document_url/documents/batch'
payload = "[{...}, {....}]"
headers = {'Content-type': 'application/json'}
response = requests.post(url, headers=headers, data=payload)
print('response code:', response.status_code)
print('response body:', response.json())
以下产量:
response code: 403
response body: {'message': 'Request forbidden by administrative rules', '__type': 'CloudSearchException'}
安全规则也对所有人开放
可能是什么问题?
根据讨论论坛:https://forums.aws.amazon.com/thread.jspa?threadID=148917
文档 url 应该是:
document_url/2013-01-01/documents/batch
在上面发帖后的回复url:
{
"status": "success",
"adds": 1,
"deletes": 0
}