Module: LoginWithGithub::ApiBase
- Included in:
- Api
- Defined in:
- lib/login_with_github/api_base.rb
Overview
make http requests
Instance Method Summary collapse
Instance Method Details
#http_delete(options) ⇒ Object
23 24 25 26 27 |
# File 'lib/login_with_github/api_base.rb', line 23 def http_delete() request = Net::HTTP::Delete.new([:uri], [:head]) request.body = [:body] if [:body] request_http(, request) end |
#http_get(options) ⇒ Object
7 8 9 10 11 |
# File 'lib/login_with_github/api_base.rb', line 7 def http_get() request = Net::HTTP::Get.new([:uri], [:head]) request.body = [:body] if [:body] request_http(, request).body end |
#http_post(options) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/login_with_github/api_base.rb', line 13 def http_post() request = Net::HTTP::Post.new([:uri], [:head]) request.body = [:body] if [:body] request.basic_auth(*[:auth]) if [:auth] return request_http(, request).body if [:body_response] request_http(, request).body end |