Sha256: 7c033f1b871c2d0edd93ea1f86033f1835937915c614e0a77ae9afde74401797

Contents?: true

Size: 306 Bytes

Versions: 1

Compression:

Stored size: 306 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, uri.port)
    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.1 lib/api-client/dispatcher.rb