| Class | FaradayMiddleware::MethodOverride |
| In: |
lib/faraday_middleware/request/method_override.rb
|
| Parent: | Faraday::Middleware |
Public: Writes the original HTTP method to "X-Http-Method-Override" header and sends the request as POST.
This can be used to work around technical issues with making non-POST requests, e.g. faulty HTTP client or server router.
This header is recognized in Rack apps by default, courtesy of the Rack::MethodOverride module. See rack.rubyforge.org/doc/classes/Rack/MethodOverride.html
| HEADER | = | "X-Http-Method-Override".freeze |
Public: Initialize the middleware.
app - the Faraday app to wrap options - (optional)
:rewrite - Array of HTTP methods to rewrite
(default: all but GET and POST)