class
Awscr::S3::Http
- Awscr::S3::Http
- Reference
- Object
Defined in:
awscr-s3/http.crConstructors
Class Method Summary
-
.seekable?(io : IO) : Bool
Determines whether an
IOis seekable (supports#posand#seekwithout error)
Instance Method Summary
-
#delete(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
Issue a DELETE request to the path with optional headers
-
#get(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
Issue a GET request to the path
-
#get(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil, &)
Issue a GET request to the path
-
#head(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
Issue a HEAD request to the path
- #max_retries : Int32
- #max_retries=(max_retries : Int32)
-
#post(path, body = nil, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
Issue a POST request to the path with optional headers, and body
-
#put(path : String, body : IO | String | Bytes, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
Issue a PUT request to the path with optional headers and body
Constructor Detail
def self.new(signer : Awscr::Signer::Signers::Interface, endpoint : URI, factory : HttpClientFactory = DefaultHttpClientFactory.new, max_retries : Int32 = 3)
#
Class Method Detail
def self.seekable?(io : IO) : Bool
#
Determines whether an IO is seekable (supports #pos and #seek without error)
Instance Method Detail
def delete(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
#
Issue a DELETE request to the path with optional headers
http = Http.new(signer)
http.delete("/")
def get(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
#
Issue a GET request to the path
http = Http.new(signer)
http.get("/")
def get(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil, &)
#
Issue a GET request to the path
http = Http.new(signer)
http.get("/") do |resp|
pp resp
end
def head(path, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
#
Issue a HEAD request to the path
http = Http.new(signer)
http.head("/")
def post(path, body = nil, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
#
Issue a POST request to the path with optional headers, and body
http = Http.new(signer)
http.post("/", body: IO::Memory.new("test"))
def put(path : String, body : IO | String | Bytes, headers : Hash(String, String) = Hash(String, String).new, retries : Int32 | Nil = nil)
#
Issue a PUT request to the path with optional headers and body
http = Http.new(signer)
http.put("/", body: IO::Memory.new("test"))