lapis
lapis copied to clipboard
Support for custom HTTP methods
currently it takes quite a considerable effort to create work-arounds to support HTTP methods such as PATCH, which behavior shouldn't really differ from POST (or any other method for that matter)
is there a reason for the core to be opinionated such as it is today? even with things like request bodies coupling with the HTTP Method behavior?
as far as the HTTP Spec goes, there is no limit to what HTTP Method strings can be/ (GET, POST, etc ...) being the common ones, and there is certainly no requirement nor association with HTTP Methods and request bodies beyond tradition.
will there be future plans to allow free-form HTTP method usage and decoupling the HTTP Method parsing from any further actions within the app?
if nothing else, then at the very least adopt the IANA Registery of HTTP Methods.
+1
:+1:
respond_to supports any verb: http://leafo.net/lapis/reference/actions.html#handling-http-verbs
Or is this in response to the helper methods get, post etc on Application in the Lua API docs? Those are just convenience wrappers on top of respond_to.
It looks like there is no documentation for respond_to except on the MoonScript page, I can add it elsewhere.
Or is this in response to the helper methods get, post etc on Application in the Lua API docs? Those are just convenience wrappers on top of respond_to.
The minimum convenience wrappers should at least cover the following: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
@leafo that helps a lot, was looking at the lua docs only, and yes for minimal convenience, as @Nijikokun indicated, should at least follow the IANA registery I believe.
should at least follow the IANA registery I believe
That would be the most optimal: http://www.iana.org/assignments/http-methods/http-methods.xhtml
@ahmadnassri I moved over a handful of documentation that was only available on the MoonScript into, you might want to look over http://leafo.net/lapis/reference/actions.html again to pick up anything you may have missed.
@leafo awesome, thank you!
@leafo Wouldn't fufilling @nijikokun 's request of supporting these methods be as simple as modifying this line to add the additional wrappers?
If so and you don't have any objections, I'll create a pull request to do just that. Are there any methods you don't want to use because they might clash with functionality you might add in the future?