Sha256: 381dddb9938511e3308e6329ab2916fd68416e761af61a875a3df52423d4cf03
Contents?: true
Size: 769 Bytes
Versions: 1
Compression:
Stored size: 769 Bytes
Contents
require 'net/http' require 'uri' module OpenAmplify # Handless HTTP requests module Request def get(path, params={}, options={}) request(:get, path, params, options) end def post(path, params={}, options={}) request(:post, path, params, options) end private def request(method, path, params, options) response = connection(options).run_request(method, nil, nil, nil) do |request| request.options[:raw] = true if options[:raw] case method.to_sym when :get request.url(path, params) when :post request.path = path request.body = params unless params.empty? end end options[:raw] ? response : response.body end end # Request end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
openamplify-0.3.0 | lib/openamplify/request.rb |