use Symfony\Component\HttpFoundation\Request; $request = Request::createFromGlobals(); $method = $request->getMethod(); if ($method === 'POST') { // Process the submitted form data } else { // Render a view that displays the form }In this example, we first create a new Request object using the createFromGlobals() method. This method creates a new Request object based on the current PHP global variables, such as $_SERVER, $_GET, $_POST, etc. We then call the getMethod() method on the Request object to retrieve the HTTP method used in the request. Finally, we use an if statement to determine whether the HTTP method is "POST" or not, and take appropriate action based on that. This example demonstrates how the Symfony HttpFoundation component can be used to handle HTTP requests in an elegant and intuitive way.