module Puppy
Defined in:
puppy.crpuppy/fetch.cr
puppy/version.cr
Constant Summary
-
UA =
"Puppy #{VERSION}"
Class Method Summary
-
.delete(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a DELETE request.
-
.delete(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a DELETE request with form data and returns a
Response. -
.delete(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a DELETE request with form data and returns a
Response. -
.exec(request : HTTP::Request, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a request.
-
.get(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a GET request.
-
.get(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a GET request with form data and returns a
Response. -
.get(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a GET request with form data and returns a
Response. -
.head(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a HEAD request.
-
.head(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a HEAD request with form data and returns a
Response. -
.head(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a HEAD request with form data and returns a
Response. -
.options(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a OPTIONS request.
-
.options(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a OPTIONS request with form data and returns a
Response. -
.options(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a OPTIONS request with form data and returns a
Response. -
.patch(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a PATCH request.
-
.patch(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a PATCH request with form data and returns a
Response. -
.patch(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a PATCH request with form data and returns a
Response. -
.post(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a POST request.
-
.post(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a POST request with form data and returns a
Response. -
.post(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a POST request with form data and returns a
Response. -
.put(path : String, headers : HTTP::Headers | Nil = nil, body : IO | Bytes | String | Nil = nil, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a PUT request.
-
.put(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a PUT request with form data and returns a
Response. -
.put(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, decompress : Bool = true, timeout : Time::Span = 10.seconds, trust_all_certs : Bool = false, proxy_addr : String | Nil = nil) : HTTP::Client::Response
Executes a PUT request with form data and returns a
Response.
Class Method Detail
Executes a DELETE request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.delete("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a DELETE request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.delete "https://www.example.com", form: "foo=bar"
Executes a DELETE request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.delete "https://www.example.com", form: {"foo" => "bar"}
Executes a request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
request = HTTP::Request.new "GET", "https://www.example.com"
response = Puppy.exec(request, decompress: true, timeout: 10.seconds, trust_all_certs: false, proxy_addr: "http://proxy_host:proxy_prort")
response.body_io.gets_to_end # => "..."
Executes a GET request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.get("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a GET request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.get "https://www.example.com", form: "foo=bar"
Executes a GET request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.get "https://www.example.com", form: {"foo" => "bar"}
Executes a HEAD request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.head("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a HEAD request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.head "https://www.example.com", form: "foo=bar"
Executes a HEAD request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.head "https://www.example.com", form: {"foo" => "bar"}
Executes a OPTIONS request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.options("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a OPTIONS request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.options "https://www.example.com", form: "foo=bar"
Executes a OPTIONS request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.options "https://www.example.com", form: {"foo" => "bar"}
Executes a PATCH request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.patch("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a PATCH request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.patch "https://www.example.com", form: "foo=bar"
Executes a PATCH request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.patch "https://www.example.com", form: {"foo" => "bar"}
Executes a POST request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.post("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a POST request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.post "https://www.example.com", form: "foo=bar"
Executes a POST request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.post "https://www.example.com", form: {"foo" => "bar"}
Executes a PUT request.
The response will have its body_io as a IO, accessed via HTTP::Client::Response#body_io.
require "puppy"
response = Puppy.put("https://www.example.com", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body_io.gets_to_end #=> "..."
Executes a PUT request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.put "https://www.example.com", form: "foo=bar"
Executes a PUT request with form data and returns a Response. The "Content-Type" header is set
to "application/x-www-form-urlencoded".
require "puppy"
response = Puppy.put "https://www.example.com", form: {"foo" => "bar"}