The Cloud Storage XML API supports several standard HTTP request methods. Each method can use numerous request headers and response headers. The XML API documentation describes all of the supported HTTP methods as well as the most frequently used headers for each method.
Some methods are used to work with both data and metadata depending on context. For example, you can use one PUT Bucket request to create a bucket followed by a second PUT Bucket request to configure logging for the bucket.
The following list shows which XML API method you use to accomplish bucket and object tasks.
- GET Service
- List Buckets in the project
- DELETE Bucket
- Delete a Bucket
- GET Bucket
- List Objects in a Bucket
- List Multipart Uploads in a Bucket (Preview)
- Get Bucket ACLs
- Get Bucket CORS
- Get Bucket Default Storage Class
- Get Bucket Encryption Configuration
- Get Bucket Labels
- Get Bucket Lifecycle
- Get Bucket Location
- Get Bucket Logging
- Get Bucket Requester Pays
- Get Bucket Versioning
- Get Bucket Website
- HEAD Bucket
- checks bucket existence
- PUT Bucket
- DELETE Object
- GET Object
- HEAD Object
- Gets Object Metadata
- POST Object
- PUT Object
- GET HMAC Key
- POST HMAC Key
Conventions used in the XML API documentation:
Authorizationheader is represented as
<authentication string>. If you are using the XML API to migrate from another storage provider, then the
Authorizationhas the format discussed in Authentication in a Simple Migration Scenario. Otherwise, the
Authorizationheader has the format discussed in OAuth 2.0 Authentication.
If you do not provide authorization information when required to perform a request, the Cloud Storage issues a 401 unauthorized error. For more information, see Status Codes.
Hostheader used in the XML API documentation is of the form:
Host: BUCKET-NAME.storage.googleapis.comwhere the bucket name is specified as part of the hostname. In all operations except GET service, you can also specify the bucket as part of the URL path. For more information, see Request Endpoints.