public function myAction(Request $request) { if ($request->isMethod('POST')) { } }
if ($request->isMethod('POST')) {...} //or GET