In this short article, we will see how to get the request method in Masonite Project.
Let's see how to do this in a controller.
app/controllers/UserController.py
from masonite.controllers import Controller
from masonite.request import Request
from masonite.facades import Dump
class UserController(Controller):
def show(self, request: Request):
Dump.dd(request.get_request_method())
Possible output could be:
GET
POST
PUT
PATCH
DELETE
OPTIONS