Closed ImLunaHey closed 1 year ago
What would be an example of a custom request method, you mean like instead of GET|PUT|POST|DELETE
you'd want something like FOO
?
Do other frameworks support this? What would be a use case for such a thing?
Most others do in one way or another.
WebDAV servers for example uses non-standard methods like MKCOL
and PROPFIND
. I've run into a few times in the past where I've needed this.
A solution for now would be to use *
and then do my own checks on request.method
.
Oh, interesting. I haven't thought about WebDAV in a very long time, but you're right, that's a legit use case for strange request methods.
I think you're right, the workaround for now is to use the *
, but I'll see about adding support for any arbitrary string like so:
app.route('MKCOL', '/webdav', (request) => {
return new Response(...);
}),
I noticed there's no way to define a custom request method.
Is this something that could possibly be added?