What's the difference between an HTTP query parameter and an HTTP form parameter? I see the words in restful related documents. Can you give an example for the words in 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.
In a POST request, parameters can appear in the URL itself, but also in the datastream (as known as content). Query string is always a part of the URL. Parameters can be buried in form-data datastream when using POST method so they may not appear in the URL.
Query parameters are a defined set of parameters attached to the end of a url. They are extensions of the URL that are used to help define specific content or actions based on the data being passed. To append query params to the end of a URL, a '? ' Is added followed immediately by a query parameter.
URI parameter (Path Param) is basically used to identify a specific resource or resources whereas Query Parameter is used to sort/filter those resources.
If you make request http://test.com?id=123, then id is a QueryParam (to be more precise this is GET request parameter), if you make POST request with a form inside body, then these form parameters (filled usually by user) are translated to FormParam-s.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With