class Bezel::Plug::MethodOverride
include Bezel::Plug
Lets an HTML form send PUT, PATCH or DELETE: a POST whose body
has _method set to one of them (in any case) gets that method. It
reads the body's parameters, so it comes after Bezel::Plug::Parsers;
the query's _method is not believed (a link could carry it).
req = HTTP::Server::Request.post("/users/1", "_method=delete",
HTTP::Headers.of({"Content-Type" => "application/x-www-form-urlencoded"}))
conn = Bezel::Plug.run([Bezel::Plug::Parsers.new, Bezel::Plug::MethodOverride.new], Bezel::Conn.build(req))
conn.method # => "DELETE"
src/plug/method_override.qz:12
Constants
METHODS: Array[String]
The methods a form may ask for.
Class methods
def self.new -> Bezel::Plug::MethodOverride
The plug.
Methods
def call(conn: Bezel::Conn) -> Bezel::Conn
The connection changed by this plug.
from Bezel::Plug