Extra Query parameters in the REST API Url
api, java, rest, resteasy, web-services
Solution
Just ignore it. Most other web servers would ignore request parameters it didn't understand.
Google ignore my two extra parameters here https://www.google.com/#q=search+for+something&invalid=param&more=stuff
Problem
In my Rest application, the resource url also support query parameters like pageSize, pageNum , name etc. So the request url looks like /resource/{id}?pageNum=1&pageSize=25&desc="hello" Now suppose a client adds an extra query parameter say 'lang' which my server is not supporting like /resource/{id}?pageNum=1&pageSize=25&desc="hello"&lang="eng" , but my server doesnt support any lang parameter. what should be the best design decision Option 1 : Ignore the extra invalid queryparam and serve the request. Option 2 : Throws bad request message to the client. Thanks in Advance Singla