pengwynn/faraday_middleware — pull request #48 by pda (2012-08-29 08:08:56+00:00)
Title: FaradayMiddleware::MethodOverride to complement Rack::MethodOverride.

Rewrites poorly supported HTTP request methods to a custom `X-Http-Method-Override` header and sends the request as `POST`.

This is supported by default in Rack / Rails apps via the `Rack::MethodOverride` module.

A current use-case is sending HTTP `PATCH` requests to an app on the Heroku Cedar stack, which does not route that request method at all.

* http://rack.rubyforge.org/doc/classes/Rack/MethodOverride.html
* https://github.com/rack/rack/blob/master/lib/rack/methodoverride.rb

Example usage:

```ruby
faraday = Faraday.new(url) do |conn|
# Send PATCH and DELETE requests as POST.
conn.request :method_override, :patch, :delete
end
```