Class: S3::PresignPutRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/s3/presign_put_request.rb

Constant Summary collapse

DEFAULT_EXPIRES_IN =
3600

Constants inherited from Request

Request::AWS_ALGORITHM, Request::AWS_REQUEST, Request::SERVICE, Request::UNSIGNED_PAYLOAD

Instance Method Summary collapse

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from S3::Request

Instance Method Details

#submit(options = nil, bucket:, key:, **kwargs) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/s3/presign_put_request.rb', line 5

def submit( options = nil, bucket:, key:, **kwargs )
  options = merge_options( options, kwargs, PresignPutOptions )

  expires_in = options[ :expires_in ] || DEFAULT_EXPIRES_IN
  path = "/#{ bucket }/#{ Helpers.encode_key( key ) }"

  generate_presigned_url( :put, path, expires_in: expires_in, content_type: options[ :content_type ] )
end