Jay
Jay

Reputation: 429

For a @GET operation which one to use @QueryParam or @FormParam

I am developing a server side application (not client). I have a list operation where I am using @GET and I am passing the parameters as @QueryParam. Should I use @FormParam? Will it be helpful while developing the client?

Upvotes: 0

Views: 889

Answers (1)

Thiago Negri
Thiago Negri

Reputation: 5351

The @FormParam annotation will expect the parameter to be in the body of the request as sent by an HTML form submit.

An HTTP GET should not use a request body. So, keep using @QueryParam for @GET.

See also:

Upvotes: 2

Related Questions