gpt4 book ai didi

google-app-engine - 谷歌云存储 JSON API : batch delete returns Unknown Error (500 Internal Server Error)

转载 作者:太空宇宙 更新时间:2023-11-03 15:35:11 25 4
gpt4 key购买 nike

我正在尝试使用文档批量删除多个对象:Sending Batch Requests .这是我的请求(<my_api_key> 是有效的 API key ,其他方法(例如存储桶的列表内容)工作正常,<my_bucket> 是确切存储桶名称的占位符):

POST /batch?key=<my_api_key>
host: www.googleapis.com
content-type:multipart/mixed; boundary="===============7330845974216740156=="

--===============7330845974216740156==
Content-Type: application/http
Content-Transfer-Encoding:binary

DELETE /storage/v1/b/<my_bucket>/o/James-Hetfield-happy.jpg
--===============7330845974216740156==

这是响应:

access-control-allow-credentials:true
access-control-allow-origin:chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
access-control-expose-headers:Cache-Control,Content-Encoding,Content-Length,Content-Type,Date,Expires,Pragma,Server,Vary
alternate-protocol:443:quic,p=0.02
cache-control:no-cache, no-store, max-age=0, must-revalidate
content-encoding:gzip
content-length:33
content-type:text/html; charset=UTF-8
date:Tue, 10 Feb 2015 16:55:14 GMT
expires:Fri, 01 Jan 1990 00:00:00 GMT
pragma:no-cache
server:GSE
status:500 Internal Server Error
vary:Origin
vary:X-Origin
version:HTTP/1.1
x-content-type-options:nosniff
x-frame-options:SAMEORIGIN
x-xss-protection:1; mode=block

Unknown Error

当我发送以下正文时:

--===============7330845974216740156==
DELETE /storage/v1/b/<my_bucket>/o/James-Hetfield-happy.jpg
--===============7330845974216740156==

我得到了 200 OK 响应 --batch_rTJhZwR1jHM_AAh2WtGp7ik--但文件仍然存在。

请告知使用 Google Cloud Storage JSON API 发送批量删除请求的正确格式。

最佳答案

我的错。从示例中复制粘贴时,在 header Content-Type: application/http 之后出现一个空格字符。当我删除请求 header 中的所有备用字符时,批量删除效果很好。

结论:复制粘贴后手动验证请求的语法。

关于google-app-engine - 谷歌云存储 JSON API : batch delete returns Unknown Error (500 Internal Server Error),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28437651/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com