Retrieving an Object

Prev Next

The get_object() method retrieves an object.

To download a specified range of bytes of an object, use the Range parameter. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.

Example

In this example, we download only bytes 32-64 of the object "MyObject" from the bucket "MyBucket".

response = S3_client.get_object(
    Bucket='MyBucket',
    Key='MyObject',
    Range='bytes=32-64',
)