Class: Xio::HTTP::NetHTTP
- Inherits:
-
Object
- Object
- Xio::HTTP::NetHTTP
- Defined in:
- lib/xio/http/net_http.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#ca_file ⇒ Object
Returns the value of attribute ca_file.
-
#ca_path ⇒ Object
Returns the value of attribute ca_path.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#options ⇒ Object
Returns the value of attribute options.
-
#params ⇒ Object
Returns the value of attribute params.
-
#skip_ssl_verify ⇒ Object
Returns the value of attribute skip_ssl_verify.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#uri ⇒ Object
writeonly
Sets the attribute uri.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .delete(url, options = {}) ⇒ Object
- .get(url, options = {}) ⇒ Object
- .post(url, options = {}) ⇒ Object
- .put(url, options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(method, url, options) ⇒ NetHTTP
constructor
A new instance of NetHTTP.
- #perform ⇒ Object
Constructor Details
#initialize(method, url, options) ⇒ NetHTTP
Returns a new instance of NetHTTP.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/xio/http/net_http.rb', line 7 def initialize(method, url, ) @method = method @url = url @options = .dup @body = @options.delete(:body) @params = @options.delete(:params) @headers = @options.delete(:headers) @timeout = @options.delete(:timeout) @skip_ssl_verify = @options.delete(:skip_ssl_verify) @ca_file = @options.delete(:ca_file) @ca_path = @options.delete(:ca_path) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def body @body end |
#ca_file ⇒ Object
Returns the value of attribute ca_file.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def ca_file @ca_file end |
#ca_path ⇒ Object
Returns the value of attribute ca_path.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def ca_path @ca_path end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def method @method end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def @options end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def params @params end |
#skip_ssl_verify ⇒ Object
Returns the value of attribute skip_ssl_verify.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def skip_ssl_verify @skip_ssl_verify end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def timeout @timeout end |
#uri=(value) ⇒ Object
Sets the attribute uri
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def uri=(value) @uri = value end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/xio/http/net_http.rb', line 5 def url @url end |
Class Method Details
.delete(url, options = {}) ⇒ Object
32 33 34 |
# File 'lib/xio/http/net_http.rb', line 32 def self.delete(url, ={}) new(:delete, url, ).perform end |
.get(url, options = {}) ⇒ Object
28 29 30 |
# File 'lib/xio/http/net_http.rb', line 28 def self.get(url, ={}) new(:get, url, ).perform end |
.post(url, options = {}) ⇒ Object
20 21 22 |
# File 'lib/xio/http/net_http.rb', line 20 def self.post(url, ={}) new(:post, url, ).perform end |
.put(url, options = {}) ⇒ Object
24 25 26 |
# File 'lib/xio/http/net_http.rb', line 24 def self.put(url, ={}) new(:put, url, ).perform end |
Instance Method Details
#perform ⇒ Object
36 37 38 |
# File 'lib/xio/http/net_http.rb', line 36 def perform deliver(http, request) end |