As a performance Engineer, I often play around with http requests and have often come across various types of requests like Get, Put, and Post etc.All these types of requests serve unique purpose though they look similar in action. They are all part of the web requests where client initiates some kind of requests to the web servers and web servers do some kind of processing based on the type of the request and data associated with that request. Most the web is formed using Get and Post requests. These 2 types of the requests dominate the web irrespective of the programming languages used.
Sometimes there might be some situations where we as a performance engineer might need to play around with web requests so it makes more sense to understand basic purposes of those types of requests, below are the some of things I can think of,
- While Get requests are normally used to fetch some kind of the information for the end users from the backend web servers. They are more like “Read” where user’s action do not update or insert anything in the backend systems. For example you click on the link for some information, and you are redirected to that link.
- Gets requests normally do not have a very large query strings going along with it.
- Data passed over the Get requests can be viewed by anyone as it goes via wire. It’s insecure in nature. We got to secure it in case if we want to use Get requests.
- Since Get request are light weight in size, they are normally very good in term of performance unless we have a lot of hops in between.
- In case if you see a request with Query String with name/value pair, then its most likely to be a “Get” request. Query Strings in the URL in most of the cases are Get Requests. Data is mostly URL encoded with Get Requests.
- The length of the Bytes transmitted with the URL is limited in Get Requests. Should be around 400+Kb.
- Static content is usually fetched via Get Requests.
- With post requests, we can read/insert/update/delete data in the backend systems.
- With Post Requests, Data flows as the part of the body of the request.
- Very large amount of bytes can flow across the wire. Good example of this is view states from .net web application.
4. They are secure as data flows as the body part of the request and in the manner as set in via content type attribute. But again it also depends on how your application designed.
- Dynamic Content or interactive content is normally fetched via Post Requests.
- Non ANSII or Binary data are normally fetched via Post requests.
Also browsers have their own way of handling Get and Post requests. The page with Get requests can be cached or Bookmarked easily with browsers whereas Post requests cannot be cached or bookmarked with Browsers.
These are some of the purposes of Get/Post requests I have seen while working with web applications build using technologies like .Net/J2EE/Open Source Web Platform. In order to get good response time and good user experience, it makes more sense to use the right type of the request in the call, so that application can leverage the inbuilt features of the browsers.
In case if you want to know and understand precise technical difference and purpose of these requests, I suggest you this link.
Comments are closed here.