Module: TinyClient::CurbRequestor
- Defined in:
- lib/tiny_client/curb_requestor.rb
Overview
Allows to perform request with Curb and wrapped the response. Curb client are attached to a current thread Fiber. ( One curb per Fiber. )
Class Method Summary collapse
-
.perform_delete(url, headers, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a delete request with Curl.
-
.perform_get(url, headers, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a get request with Curl.
-
.perform_head(url, headers, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a head request with Curl.
-
.perform_post(url, headers, content, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a post request with Curl.
-
.perform_put(url, headers, content, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a put request with Curl.
Class Method Details
.perform_delete(url, headers, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a delete request with Curl
53 54 55 56 |
# File 'lib/tiny_client/curb_requestor.rb', line 53 def perform_delete(url, headers, connect_timeout, verbose) perform(:DELETE, url, nil, nil, headers: headers, connect_timeout: connect_timeout, verbose: verbose) end |
.perform_get(url, headers, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a get request with Curl
15 16 17 18 |
# File 'lib/tiny_client/curb_requestor.rb', line 15 def perform_get(url, headers, connect_timeout, verbose) perform(:GET, url, nil, nil, headers: headers, connect_timeout: connect_timeout, verbose: verbose) end |
.perform_head(url, headers, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a head request with Curl
65 66 67 68 |
# File 'lib/tiny_client/curb_requestor.rb', line 65 def perform_head(url, headers, connect_timeout, verbose) perform(:HEAD, url, nil, nil, headers: headers, connect_timeout: connect_timeout, verbose: verbose) end |
.perform_post(url, headers, content, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a post request with Curl
41 42 43 44 |
# File 'lib/tiny_client/curb_requestor.rb', line 41 def perform_post(url, headers, content, connect_timeout, verbose) perform(:POST, url, content, nil, headers: headers, connect_timeout: connect_timeout, verbose: verbose) end |
.perform_put(url, headers, content, connect_timeout, verbose) ⇒ TinyClient::Response
Perform a put request with Curl
28 29 30 31 |
# File 'lib/tiny_client/curb_requestor.rb', line 28 def perform_put(url, headers, content, connect_timeout, verbose) perform(:PUT, url, nil, content, headers: headers, connect_timeout: connect_timeout, verbose: verbose) end |