How to create an empty folder on Google Storage with Google API? (Assume that /
is path separator.)
@SheRey - looking at folders created via the GCS web interface, the Content-Type is set to application/x-www-form-urlencoded;charset=UTF-8
but it doesn't really matter. Here's what worked for me in python:
# pip install google-cloud-storage
from google.cloud import storage
gcs_client = storage.Client(project='some_project')
bucket = gcs_client.get_bucket('some_bucket')
blob = bucket.blob('some/folder/name/')
blob.upload_from_string('', content_type='application/x-www-form-urlencoded;charset=UTF-8')