Home FOSRestBundle : Difference between RequestParam and QueryParam
Reply: 1

FOSRestBundle : Difference between RequestParam and QueryParam

graille
1#
graille Published in 2018-02-13 19:20:02Z

I don't understand the difference between the @QueryParam et the @RequestParam annotation with FOSRestBundle (Example : https://symfony.com/doc/master/bundles/FOSRestBundle/param_fetcher_listener.html).

Do you have any mean to know which one I have to use to declare my API parameters ?

Ty

dlondero
2#
dlondero Reply to 2018-02-13 20:13:36Z

Depends on what you want to achieve with your API endpoints. Basically QueryParam represents a parameter that must be present in GET data (so we're talking about query string parameters) while RequestParam represents a parameter that must be present in POST data (which means parameters in the body of the POST).

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308481 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO