Sha256: 3e05b514edd8ff53bfbd9e40604bc56fc6e3cf60a3037a30bd19b7ba38b5285d
Contents?: true
Size: 1007 Bytes
Versions: 2
Compression:
Stored size: 1007 Bytes
Contents
require 'faraday' require 'smartsheet/api/request' require 'smartsheet/api/faraday_adapter/middleware/faraday_error_translator' require 'smartsheet/api/faraday_adapter/middleware/response_parser' module Smartsheet module API class FaradayNetClient def initialize create_connection end # Expected output: # - returned Success Response # - returned Error Response # - thrown Request Error def make_request(request) response = conn.send(request.method) do |req| req.url(request.url) req.headers = request.headers req.params = request.params req.body = request.body end response.body end private def create_connection @conn = Faraday.new do |conn| conn.use Middleware::FaradayErrorTranslator conn.use Middleware::ResponseParser conn.adapter Faraday.default_adapter end end attr_reader :conn end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
smartsheet-1.0.0.beta.2 | lib/smartsheet/api/faraday_adapter/faraday_net_client.rb |
smartsheet-1.0.0.beta.0 | lib/smartsheet/api/faraday_adapter/faraday_net_client.rb |