-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support XML API for Resumable Upload #60
Comments
I think the key thing here is that the XML API requires the header |
@anshulpatel25 Does the upload work for you if you pass in the appropriate header to the constructor, e.g.: xml_api_headers = {'x-goog-resumable': 'start'}
upload = ResumableUpload(signed_url, 1024*1024, headers=xml_api_headers)
response = upload.initiate(transport, stream, metadata, "text/plain", total_bytes=total_bytes) |
Hey @tseaver Only adding Working >>> xml_api_headers
{'x-goog-resumable': 'start', 'content-type': 'text/plain'}
>>> upload = ResumableUpload(signed_url, 1024*1024, headers=xml_api_headers)
>>> p = upload.initiate(transport, stream, metadata, file_content_type)
......
HTTP/1.1" 201 0 Not Working >>> xml_api_headers
{'x-goog-resumable': 'start'}
>>> upload = ResumableUpload(signed_url, 1024*1024, headers=xml_api_headers)
>>> x = upload.initiate(transport, stream, metadata, file_content_type)
......
google.resumable_media.common.InvalidResponse: ('Response headers must contain header', 'location') Thanks |
@anshulpatel25 Thanks for the research! Looks like #99 needs a different approach, as the See the XML API docs for requirements:
|
Expected Behavior
gsutil
.ResumableUpload
Actual Behavior
gsutil
.gsutil signurl -d 600m ~/Downloads/key.json gs://<gcs_bucket>/<file_name>.txt
.ResumableUpload
It seems like the
ResumableUpload
doesn't interpret XML API endpoint.Specifications
The text was updated successfully, but these errors were encountered: