diff --git a/lib/faraday/request.rb b/lib/faraday/request.rb index 9a97ba79b..d139727b8 100644 --- a/lib/faraday/request.rb +++ b/lib/faraday/request.rb @@ -132,6 +132,7 @@ def to_env(connection) require 'faraday/request/authorization' require 'faraday/request/instrumentation' +require 'faraday/request/json' require 'faraday/request/multipart' require 'faraday/request/retry' require 'faraday/request/url_encoded' diff --git a/lib/faraday/request/json.rb b/lib/faraday/request/json.rb index a17a4dd06..fa219c49d 100644 --- a/lib/faraday/request/json.rb +++ b/lib/faraday/request/json.rb @@ -51,3 +51,5 @@ def request_type(env) end end end + +Faraday::Request.register_middleware(json: Faraday::Request::Json) diff --git a/lib/faraday/response.rb b/lib/faraday/response.rb index 505e4ea43..3dd1bc520 100644 --- a/lib/faraday/response.rb +++ b/lib/faraday/response.rb @@ -85,5 +85,6 @@ def apply_request(request_env) end end +require 'faraday/response/json' require 'faraday/response/logger' require 'faraday/response/raise_error' diff --git a/lib/faraday/response/json.rb b/lib/faraday/response/json.rb index 19fa72047..399b7f351 100644 --- a/lib/faraday/response/json.rb +++ b/lib/faraday/response/json.rb @@ -50,3 +50,5 @@ def response_type(env) end end end + +Faraday::Response.register_middleware(json: Faraday::Response::Json)