If you want to do it in controller,
$this->getRequest()->isMethod('GET');
or in your model (service), inject or pass the Request object to your model first, then do the same like the above.
Edit: for Symfony 3 use this code
if ($request->isMethod('post')) {
// your code
}