Crest
This module's static methods are the entry point for using the Crest client.
Supported HTTP methods: get, put, post, patch delete, options, head
Examples:
Crest.get(
"http://httpbin.org/get",
headers: {"Content-Type" => "image/jpg"},
params: {"lang" => "en"}
)
Crest.post(
"http://httpbin.org/post",
headers: {"Access-Token" => ["secret1", "secret2"]},
form: {"fizz" => "buz"},
logging: true,
)
Crest.get("http://httpbin.org/stream/5") do |response|
while line = response.body_io.gets
puts line
end
end
Constants
Hash of HTTP status code => message.
Class methods
Execute a DELETE request and and yields the Crest::Response to the block.
Crest.delete("http://httpbin.org/delete") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a DELETE request and returns a Crest::Response.
Crest.delete("http://httpbin.org/delete")
Execute a GET request and and yields the Crest::Response to the block.
Crest.get("http://httpbin.org/get") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a GET request and returns a Crest::Response.
Crest.get("http://httpbin.org/get")
Execute a HEAD request and and yields the Crest::Response to the block.
Crest.head("http://httpbin.org/head") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a HEAD request and returns a Crest::Response.
Crest.head("http://httpbin.org/head")
Execute a OPTIONS request and and yields the Crest::Response to the block.
Crest.options("http://httpbin.org/options") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a OPTIONS request and returns a Crest::Response.
Crest.options("http://httpbin.org/options")
Execute a PATCH request and and yields the Crest::Response to the block.
Crest.patch("http://httpbin.org/patch") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a PATCH request and returns a Crest::Response.
Crest.patch("http://httpbin.org/patch")
Execute a POST request and and yields the Crest::Response to the block.
Crest.post("http://httpbin.org/post") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a POST request and returns a Crest::Response.
Crest.post("http://httpbin.org/post")
Execute a PUT request and and yields the Crest::Response to the block.
Crest.put("http://httpbin.org/put") do |response|
while line = response.body_io.gets
puts line
end
end
Execute a PUT request and returns a Crest::Response.
Crest.put("http://httpbin.org/put")
Nested types
- Crest::CommonLogger
- Crest::Curlify
- Crest::DataForm(T)
- Crest::EnumeratedFlatParamsEncoder
- Crest::FlatParamsEncoder
- Crest::Form(T)
- Crest::JSONForm(T)
- Crest::Logger
- Crest::NestedParamsEncoder
- Crest::ParamsDecoder
- Crest::ParamsEncoder
- Crest::ParamsValue
- Crest::Redirector
- Crest::Request
- Crest::RequestFailed
- Crest::Resource
- Crest::Response
- Crest::StreamDataForm(T)
- Crest::UrlencodedForm(T)
- Crest::ZeroEnumeratedFlatParamsEncoder