class Awscr::S3::Presigned::Form
- Awscr::S3::Presigned::Form
- Reference
- Object
Defined in:
awscr-s3/presigned/form.crConstructors
-
.new(post : Post, client : HTTP::Client)
Create a form with a Post object and an IO.
Class Method Summary
Instance Method Summary
-
#fields
The fields of the form.
-
#submit(io : IO)
Submit the
Form
. -
#to_html
Represent this
Presigned::Form
as raw HTML. -
#url
The url of the form.
Constructor Detail
Create a form with a Post object and an IO.
Class Method Detail
def self.build(region, aws_access_key, aws_secret_key, signer = :v4, &)
#
Create a new Form
Building a Form
Awscr::S3::Presigned::Form.build("us-east-1", "aws key", "aws secret") do |form|
form.expiration(Time.unix(Time.local.to_unix + 1000))
form.condition("bucket", "my bucket")
form.condition("acl", "public-read")
form.condition("key", "helloworld.png")
form.condition("Content-Type", "image/png")
form.condition("success_action_status", "201")
end