lib/meroku/api.rb in meroku-2.0.22 vs lib/meroku/api.rb in meroku-2.0.23
- old
+ new
@@ -1,8 +1,20 @@
-require 'meroku/api/request'
+# frozen_string_literal: true
module Meroku
- # The api is the rails app/service running on the ec2 server
- # handling login, logout, keys:add etc
+ # Logic related to making rest api calls to backend rails server
module Api
+ def post(data)
+ # response = RestClient.post "https://www.example.net", data.to_json
+ # puts "DB8 #{response.inspect}"
+ # true
+ # response = RestClient.post(url, data.to_json,
+ # timeout: 1,
+ # content_type: :json,
+ # accept: :json)
+ # r = JSON.parse(response)
+ # yield(r["data"]) if r.key?("data")
+ # return unless r.key?("errors") && r["errors"].size.positive?
+ # puts "error: #{r['errors'].map { |x| x['detail'] }.join('. ')}"
+ end
end
end