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?!
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)