Sha256: 3943a61e281555c4ff7c324cfaf7e2c6c695ad99f721c63ac3cbb67c004e7ca3
Contents?: true
Size: 713 Bytes
Versions: 2
Compression:
Stored size: 713 Bytes
Contents
# frozen_string_literal: true module Meroku # 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
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
meroku-2.0.24 | lib/meroku/api.rb |
meroku-2.0.23 | lib/meroku/api.rb |