Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between an HTTP query parameter and HTTP form parameter? [closed]

Tags:

java

rest

http

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.

like image 534
jiafu Avatar asked Apr 09 '12 14:04

jiafu


People also ask

What is the difference between form parameter and query parameter?

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.

What is difference between query and parameter?

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.

What is HTTP query parameter?

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.

What is the difference between query parameter and URI 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.


1 Answers

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.

like image 91
Piotr Kochański Avatar answered Sep 28 '22 02:09

Piotr Kochański