Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Go to Latest
variable methodOverride
import { methodOverride } from "https://deno.land/x/hono@v4.2.5/middleware/method-override/index.ts";

Method Override Middleware

Examples

// with form input method const app = new Hono() app.use('/books/', methodOverride({ app })) // the default form value is _method app.use('/authors/', methodOverride({ app, form: 'method' }))

// with custom header app.use('/books/*', methodOverride({ app, header: 'X-HTTP-METHOD-OVERRIDE' }))

// with query parameter app.use('/books/*', methodOverride({ app, query: '_method' }))

type

(options: MethodOverrideOptions) => MiddlewareHandler