Closed
Description
Hi,
the code in the HttpRequest.__init__
is useless:
# Pull the multipart boundary out of the content-type header.
major, minor, params = mimeparse.parse_mime_type(
self.headers.get('content-type', 'application/json'))
And it prevents from storage.insert
creating explicit dirs without content-type. I.e. this code pass only with the above code removed:
api = googleapiclient.discovery.build('storage', 'v1', credentials=credentials)
media = googleapiclient.http.MediaIoBaseUpload(io.BytesIO(b''), '')
resp = api.objects().insert(bucket=bucket, name='testdir/', media_body=media).execute()
BTW similar code with empty contentType works on the .NET client, too.