Request Object

Besides the values of the routing placeholders, the controller also has access to the Request object when extending the base Controller class:
$request = $this->getRequest();
$request->isXmlHttpRequest(); // is it an Ajax request?
$request->getPreferredLanguage(array('en', 'fr'));
$request->query->get('page'); // get a $_GET parameter.
$request->request->get('page'); // get a $_POST parameter.

Response Object

The only requirement for a controller is to return a Response object. The Response3 class is a PHP abstraction around the HTTP response - the text-based message filled with HTTP headers and content that's sent back to the client:
use Symfony\Component\HttpFoundation\Response;
// create a simple Response with a 200 status code (the default)
$response = new Response('Hello '.$name, 200);
// create a JSON-response with a 200 status code
$response = new Response(json_encode(array('name' => $name)));
$response->headers->set('Content-Type', 'application/json');