Loading Image

Thursday, September 3, 2020

GET and POST Method in Http JAVA

HTTP: The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers.
HTTP works as a request-response protocol between a client and a server.
                                        
                                                                    Figure: GET & POST in Systems

Some Properties of the GET method:
GET is used to request data from a specified resource. It appends form-data to the URL in name/ value pairs. It is a read-only method. The length of the URL is limited by 2048 characters. This method must not be used if you have a password or some sensitive information to be sent to the server. It is used for submitting the form where the user can bookmark the result. It is better for data that is not secure. It cannot be used for sending binary data like images or word documents. It also provides $_GET associative array to access all the sent information using the GET method. 

Some Properties of the POSTmethod:
POST is used to send data to a server to create/update a resource. It is a write method. Using this user can update or push his data into the server. 
This method does not have any restrictions on data size to be sent. Submissions by form with POST cannot be bookmarked. This method can be used to send ASCII as well as binary data like image and word documents. Data sent by the POST method goes through HTTP header so security depends on the HTTP protocol. You have to know that your information is secure by using secure HTTP. This method is a little safer than GET because the parameters are not stored in browser history or in web server logs. It also provides $_POST associative array to access all the sent information using the POST method.


2 comments: