class Awscr::S3::Http

Defined in:

awscr-s3/http.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(signer : Awscr::Signer::Signers::Interface, region : String = standard_us_region, custom_endpoint : String? = nil) #

[View source]

Instance Method Detail

def delete(path, headers : Hash(String, String) = Hash(String, String).new) #

Issue a DELETE request to the path with optional headers

http = Http.new(signer)
http.delete("/")

[View source]
def get(path, headers : Hash(String, String) = Hash(String, String).new) #

Issue a GET request to the path

http = Http.new(signer)
http.get("/")

[View source]
def get(path, headers : Hash(String, String) = Hash(String, String).new, &) #

Issue a GET request to the path

http = Http.new(signer)
http.get("/") do |resp|
  pp resp
end

[View source]
def head(path, headers : Hash(String, String) = Hash(String, String).new) #

Issue a HEAD request to the path

http = Http.new(signer)
http.head("/")

[View source]
def post(path, body = nil, headers : Hash(String, String) = Hash(String, String).new) #

Issue a POST request to the path with optional headers, and body

http = Http.new(signer)
http.post("/", body: IO::Memory.new("test"))

[View source]
def put(path : String, body : IO | String | Bytes, headers : Hash(String, String) = Hash(String, String).new) #

Issue a PUT request to the path with optional headers and body

http = Http.new(signer)
http.put("/", body: IO::Memory.new("test"))

[View source]