Module: MagicBell::ApiOperations
Instance Method Summary collapse
Instance Method Details
#get(url, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/magicbell/api_operations.rb', line 3 def get(url, = {}) response = HTTParty.get( url, .merge(headers: authentication_headers) ) raise_http_error_unless_2xx_response(response) response end |
#post(url, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/magicbell/api_operations.rb', line 13 def post(url, = {}) response = HTTParty.post( url, .merge(headers: authentication_headers) ) raise_http_error_unless_2xx_response(response) response end |
#put(url, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/magicbell/api_operations.rb', line 23 def put(url, = {}) response = HTTParty.put( url, .merge(headers: authentication_headers) ) raise_http_error_unless_2xx_response(response) response end |