What is difference between doGet() and doPost() ?
doGet() and doPost() both these methods comes under HTTP protocol.Let's discuss the important difference between these two.
doGet()
- doGet() is used when we have to transfer very fewer data.The maximum is 240 byte.
- In doGet parameter are appended in URL and visible to the user so we should not use doGet() to transfer the critical data such as username and password.Parameters are not encrypted.
- We mostly use do get when we want to input fewer data and fetch more data.For example, fetch employee list by passing department.
- doGet() is faster than doPost().
- It is default request method.
- This URL can be bookmarked.
- doGet() method is idempotent thus it can be repeated multiple time safely.
doPost()
- doPost() methods are used we want to send form data.Data amount does not have any limit.
- It provides encryption thus data security.
- It is not idempotent.
- It cannot be bookmarked.
- It supports file uploading unlike doGet.
- Parameters are sent in the body, not in URL.
You may be interested in Java- Inheritance.
Give you suggestion in comments.If you like the post Share with your friends on social network.
What is difference between doGet() and doPost() ?
Reviewed by JavaInstance
on
3:40:00 AM
Rating:
Reviewed by JavaInstance
on
3:40:00 AM
Rating:

No comments: