Class: Netting
- Inherits:
-
Object
- Object
- Netting
- Defined in:
- lib/netting.rb
Overview
A wrapper around Net::HTTP::Post and Get methods.
Constant Summary collapse
- @@Timeout =
sec
4
Instance Method Summary collapse
-
#get(*stuff) ⇒ Object
Sends HTTP GET and returns the answer.
-
#initialize(url) ⇒ Netting
constructor
A full URL has to be given, starting with http:, ending in the port (if port is not the default).
-
#post(*stuff) ⇒ Object
Sends HTTP POST, data as json.
Constructor Details
Instance Method Details
#get(*stuff) ⇒ Object
Sends HTTP GET and returns the answer
25 26 27 |
# File 'lib/netting.rb', line 25 def get *stuff send_req Net::HTTP::Get, *stuff end |
#post(*stuff) ⇒ Object
Sends HTTP POST, data as json
19 20 21 |
# File 'lib/netting.rb', line 19 def post *stuff send_req Net::HTTP::Post, *stuff end |