Home  >  Forum  >  Web Services
Post New Query

Difference between JAX-RS @QueryParam and @FormParam



Asked on March 10, 2015
What is difference between JAX-RS @QueryParam and @FormParam.
I am new to REST web service. Can we use together?



Replied on March 10, 2015
In REST Service, JAX-RS provides @QueryParam and @FormParam both for accepting data from HTTP request. An HTTP form can be submitted by different methods like GET and POST.

@QueryParam : Accepts GET request and reads data from query string.

EX.


@FormParam: Accepts POST request and fetches data from HTML form or any request of the media type application/x-www-form-urlencoded.

EX.


Write Answer







©2019 concretepage.com | Privacy Policy | Contact Us