尝试重命名Google Bucket对象时出错(Google bug?) [英] An error attempting to rename a Google Bucket object (Google bug?)

查看:122
本文介绍了尝试重命名Google Bucket对象时出错(Google bug?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试重新命名一个存储桶中的对象(以下称为BUCKET)。我获得访问令牌(XXX)并在下面使用它。但它不起作用。查看记录:

I try to rename an object in a bucket (below named BUCKET). I obtain an access token (XXX) and use it below. But it does not work. See the transcript:

$ curl -X POST -H "Authorization: Bearer XXX" \
"https://www.googleapis.com/upload/storage/v1/b/BUCKET/o/rdf.ads/rewriteTo/b/BUCKET/o/xxx"
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badContent",
    "message": "Unsupported content with type: application/octet-stream"
   }
  ],
  "code": 400,
  "message": "Unsupported content with type: application/octet-stream"
 }
}

我认为这是一个Google bug。或者为什么它不起作用?

I think it is a Google bug. Or why does it not work?!

推荐答案

您需要删除该路径中的上传前缀(请参阅HTTP请求记录在 https://cloud.google.com/storage/docs/ json_api / v1 / objects / rewrite

You need to remove the "upload" prefix in that path (see the HTTP request documented at https://cloud.google.com/storage/docs/json_api/v1/objects/rewrite)

这篇关于尝试重命名Google Bucket对象时出错(Google bug?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆