GET Bucket

Use a GET bucket request to:

If you make a GET request that's scoped to a bucket that doesn't exist, youget a404 Not Found statuscode, and the body of the error response containsNoSuchBucketin theCode element.

Common request headers

The following are common request headers for GET bucket requests.

HeaderDescriptionRequired
AuthorizationThe authentication string for the request.Yes
Content-Length

The length of the request body without headers (in bytes).

* Not required for requests that use chunked transfer encoding.

Yes*
DateThe date and time of the request.Yes
HostThe URI for Cloud Storage. For more information, seeRequest Endpoints.Yes
x-goog-if-metageneration-matchFor the request to succeed, the value specified for this header must match themetageneration of the requested bucket. If it does not, the request fails with a412 Precondition Failed status code. Note that this header is ignored in list requests.No
x-goog-user-projectThe project to be billed for charges associated with the request.No

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.