Sha256: b88e5a08db98862b4abf235fadcede001df6bbfc6f8fc4195afdc216e4115b16

Contents?: true

Size: 296 Bytes

Versions: 1

Compression:

Stored size: 296 Bytes

Contents

require "net/http"

module ApiClient::Dispatcher
  def _get(url = '')
    Net::HTTP.get_response(URI.parse(url))
  end

  def _post(url = '', args = {})
    uri = URI(url)
    http = Net::HTTP.new(uri.host)
    http.post(uri.path, args.to_json, { 'Content-Type' => 'application/json' })
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
api-client-1.1.0 lib/api-client/dispatcher.rb