Sha256: 226182cfa733fea6454561e3657547033a28c1e95037ec7d33c05de5d3e1ba20
Contents?: true
Size: 704 Bytes
Versions: 1
Compression:
Stored size: 704 Bytes
Contents
require "active_record" require "nokogiri" require "rails_api_logger/version" require "rails_api_logger/request_log" require "rails_api_logger/inbound_request_log" require "rails_api_logger/outbound_request_log" require "rails_api_logger/inbound_requests_logger" require "rails_api_logger/inbound_requests_logger_middleware" module RailsApiLogger class Error < StandardError; end def self.call(uri, http, request) log = OutboundRequestLog.from_request(request) http.request(request).tap do |response| log.response_code = response.code log.response_body = response.body end rescue => e log.response_body = {error: e.message} raise ensure log.save! end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_api_logger-0.3.0 | lib/rails_api_logger.rb |