Skip to content

Response class

Peter Boling requested to merge github/fork/paulwalker/response_class into master

Created by: paulwalker

Response wrapping has been refactored to one class with the following benefits:

  • a #parsed property will attempt to parse the body response for x-www-form-urlencoded and json response bodies. if that fails, it will fallback to the original response body. the :parse_json option has been removed
  • the original faraday response instance is available in a #response property.
  • headers, status, body and the original response instance are always available to clients. the previous implementation did not always make these values available.
  • by making use of the #parsed property, this cleans up the token parsing logic
  • less code

Additionally, json parsing specs have been removed as testing coverage is provided by response_spec.rb

Merge request reports

Loading