Module: WxExt::Helper
Overview
WxExt Helper like get and post short method.
Instance Method Summary collapse
-
#http_get(url, headers = {}) ⇒ Hash
Http get helper of this gem, always return a hash.
-
#http_post(url, params, headers = {}) ⇒ Hash
Http post helper of this gem, always return a hash.
Instance Method Details
#http_get(url, headers = {}) ⇒ Hash
Http get helper of this gem, always return a hash.
16 17 18 19 |
# File 'lib/wx_ext/helper.rb', line 16 def http_get(url, headers = {}) res = RestClient.get url, headers JSON.parse res end |
#http_post(url, params, headers = {}) ⇒ Hash
Http post helper of this gem, always return a hash.
27 28 29 30 |
# File 'lib/wx_ext/helper.rb', line 27 def http_post(url, params, headers = {}) res = RestClient.post url, params, headers JSON.parse res end |