我沒有看到使用最新的v4 api爲activities
端點執行批量操作的303響應。Clio API:批量操作不返回303狀態代碼
請與同值真正的X BULK報頭中的動作的請求。答覆將始終爲202接受。
輪詢響應位置標題中提供的URL。此URL適用於批量操作端點。
動作完成後,輪詢URL將返回303 See Other響應。
從303的位置標題中的URL下載響應請參閱其他響應。
下面是我在做什麼:
我發出初始請求的活動與X-BULK
頭設置爲'true'
端點。
- 我收到一個
202 Accepted
迴應,其中一個Location
標頭設置爲輪詢url。
我開始輪詢從Location
標題提供的url。
- 我收到了幾
200
的回答與下列數據和標題:
數據:
{"data":{"id":26952539,"etag":"\\"434fa52f83b8e0bb72677f60b8297866\\""}}
頁眉:
{
'content-type': 'application/json; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
vary: 'Accept-Encoding',
status: '200 OK',
'last-modified': 'Sat, 02 Dec 2017 22:17:13 GMT',
'x-ratelimit-limit': '50',
'x-ratelimit-reset': '1512253080',
'x-ratelimit-remaining': '45',
'x-request-id': '4674a764-c417-448c-af09-c6dae1cabe15',
etag: '"434fa52f83b8e0bb72677f60b8297866"',
'x-frame-options': 'SAMEORIGIN',
'cache-control': 'no-cache, private, no-store',
'x-xss-protection': '1; mode=block',
'x-api-version': '4.0.5',
'x-content-type-options': 'nosniff',
date: 'Sat, 02 Dec 2017 22:17:13 GMT',
'set-cookie':
[ 'XSRF-TOKEN=oQqTKV8XKRm9oiMuY1OFZ6qleZyRyvtcs9v52%2FWyeiVXxvVszHLiXsQkWelnUHs3ErSsH64ctIpehxErulAWHg%3D%3D; path=/; secure',
'_session_id=7babc5f94bc48ecd5d18d4b40c17d6ca; path=/; secure; HttpOnly' ],
server: 'nginx',
'strict-transport-security': 'max-age=31536000; includeSubdomains'
}
但是一個303
永遠不會到來。一些上述200
S的後,我得到另一個200
與有效載荷:
數據:
{
"data": [
{
"data": [ {id: 1...}, {id: 2...}, {id: 3...}, ... ],
"status": 200
}
],
"status": "completed",
"requested": 46,
"performed": 46
}
頁眉:
{
'x-amz-id-2': '1uiNt20Vd/X74JxKZKrt/hah7aof8xfhZlt7fhlDt8b3G2nA47Y8ZDaohb2drSF8ErniirRK2Es=',
'x-amz-request-id': '2B29557952779E29',
date: 'Sat, 02 Dec 2017 22:17:15 GMT',
'last-modified': 'Sat, 02 Dec 2017 22:17:14 GMT',
'x-amz-expiration': 'expiry-date="Wed, 06 Dec 2017 00:00:00 GMT", rule-id="Expiration rule (auto-generated)"',
etag: '"58e33e4eced83d145bf6dec9f72b97be-1"',
'x-amz-server-side-encryption': 'AES256',
'content-encoding': 'utf-8',
'x-amz-version-id': '2Ou7F__59Pz8WKOKZwFg_fOuhQjD5ro0',
'content-disposition': 'attachment; filename="activities 20171202.json";',
'accept-ranges': 'bytes',
'content-type': 'application/json',
'content-length': '9593',
server: 'AmazonS3',
connection: 'close'
}
看來我可以解決此足以通過測試status === 'completed'
,甚至檢查是否存在content-disposition
標題。
我做錯了什麼,阻止了303
響應,或者是否存在我忽略的activities
端點的語義?
是否足夠測試status === 'completed'
解決此問題?
注意:我通過Authorization
標頭爲每個請求,其中包括訪問令牌。
謝謝!
快速問題來幫助重現問題,您正在使用哪個工具? cURL,Postman或node.js API客戶端? –
@MatthewHoag,我在Express框架中使用了一個node.js應用程序。 –