c# - Errors with CopyRequest and RewriteRequest in Google Cloud Storage -


i'm trying copy , move objects between buckets in google cloud storage using .net api. far can tell constructing request correctly , have verified properties setting below correct , should following cryptic error:

google.googleapiexception : google.apis.requests.requesterror required [400] errors [     message[required] location[ - ] reason[required] domain[global] ]   

here code

google.apis.storage.v1.data.object moveobj = new google.apis.storage.v1.data.object() { name = key, size = (ulong)length, contenttype = contenttype }; objectsresource.rewriterequest req = new objectsresource.rewriterequest(_gcsclient, newobj,sourcebucket, key, destbucket, key); req.execute(); 

any idea might doing wrong?

i figured out on own, answer if you're having same issue. credit poorly written , inconsistent cloud storage api more anything. every other operation when create storage 'object' specify name (see first param):

new google.apis.storage.v1.data.object() { name = key, size = (ulong)length, contenttype = contenttype }; 

but reason breaks when trying move or copy object in case can omit passing destinationkey property writerequest/copyrequest anyway, this:

new google.apis.storage.v1.data.object() {size = (ulong)length, contenttype = contenttype }; 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -