Hi symfonians ! ^^

Once again... such a long time since my last post! (4 years! Yikes!) This is mainly because I have a lot to do with the Symfony projects I actually develop/maintain as a contractor. (3 million users/month). This post is an update of a previous one related to Symfony2. The request class is one of most frequently used in a Symfony project as it is tied (and injected) with controllers.

Considering the following URL:

http://dev.com/app_dev.php/my-route?bar=1&foo=bar


Here are the results of the different main public methods of the Symfony\Component\HttpFoundation\Request class:

Will produce the following output:


See you. COil :)

PS: Note that the fragment (#fragment) part of the URL can't be retrieved server side. But it can be added when generating URLs via the routing service.