Class | FaradayMiddleware::EncodeJson |
In: |
lib/faraday_middleware/request/encode_json.rb
|
Parent: | Faraday::Middleware |
Request middleware that encodes the body as JSON.
Processes only requests with matching Content-type or those without a type. If a request doesn‘t have a type but has a body, it sets the Content-type to JSON MIME-type.
Doesn‘t try to encode bodies that already are in string form.
CONTENT_TYPE | = | 'Content-Type'.freeze |
MIME_TYPE | = | 'application/json'.freeze |