porton
porton

Reputation: 5825

An error attempting to rename a Google Bucket object (Google bug?)

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"
 }
}

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

Upvotes: 0

Views: 357

Answers (1)

Mike Schwartz
Mike Schwartz

Reputation: 12155

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)

Upvotes: 2

Related Questions