ruby/example_code/s3/s3-ruby-example-access-permissions.rb
def object_content_by_object_unsigned_request(bucket_name, object_key, region)
  object_path = "https://s3.#{region}.amazonaws.com/#{bucket_name}/#{object_key}"
  response = Net::HTTP.get(URI(object_path))
  puts "Content of unsigned request to '#{object_path}':\n\n#{response}\n\n"
end
# Prints information about the Amazon S3 object in the bucket
#   at the given path.
#
# Prerequisites:
#
# - An Amazon S3 bucket.
# - An object in the bucket.
#
# @param bucket_name [String] The bucket's name.
# @param object_key [String] The name of the object in the bucket.
# @param region [String] The AWS Region for the bucket.
# @example
#   object_content_by_object_unsigned_request(
#     'doc-example-bucket',
#     'my-file.txt',
#     'us-west-2'
#   )

Prints information about the Amazon S3 object in the bucket
at the given path.



An Amazon S3 bucket.
An object in the bucket.
Prints information about the Amazon S3 object in the bucket at the given path . An Amazon S3 bucket . An object in the bucket .
def object_content_by_object_unsigned_request(bucket_name, object_key, region)
  object_path = "https://s3.#{region}.amazonaws.com/#{bucket_name}/#{object_key}"
  response = Net::HTTP.get(URI(object_path))
  puts "Content of unsigned request to '#{object_path}':\n\n#{response}\n\n"
end
def object_content_by_object_unsigned_request ( bucket_name , object_key , region ) object_path = "https://s3.#{region}.amazonaws.com/#{bucket_name}/#{object_key}" response = Net :: HTTP . get ( URI ( object_path ) ) puts "Content of unsigned request to '#{object_path}':\n\n#{response}\n\n" end
Prints information about the Amazon S3 object in the bucket
at the given path.
Prints information about the Amazon S3 object in the bucket at the given path .
bucket_name
The bucket's name.
The bucket ' s name .
object_key
The name of the object in the bucket.
The name of the object in the bucket .
region
The AWS Region for the bucket.
The AWS Region for the bucket .
example
object_content_by_object_unsigned_request( 'doc-example-bucket', 'my-file.txt', 'us-west-2' )
object_content_by_object_unsigned_request ( ' doc - example - bucket ' ' my - file . txt ' ' us - west - 2 ' )