What is HTTP ?
HTTP stand for Hyper Text Transfer Protocol And it’s basically responsible for communication between client and server. Using HTTP request and response they communicate with each other.
For example:
- Loading pages
- Form submit
- Ajax calls
Next important thing is HTTP is stateless. That’s mean every request is completely independent. It’s similar to transaction. Other thing is we can enhanced user experience using programming, Local storage , Cookies , Session etc.
HTTP Methods?
Whenever request made to a server it has some kind of method attached to it. That method indicate the action to be perform for a given resources. Except some common features Each of them implements a different semantic.
Common features : a request method can be safe, idempotent, or cacheable.

- GET
- Responsible of GET method is retrieve data from the server.
- GET method only read the data, not change it.
- GET returns a representation in XML or JSON
- If error occur return 404 or 400 error.
- POST
- Responsible for submit data to the server.
- Something like to ‘ CREAT ‘.
- If creation is success return 201 HTTP status.
- If error occur return 404 or 409 error.
- PUT
- Responsible for update data that already in server.
- Same as UPDATE.
- In some case PUT can use to create resource.
- If PUT is success return 200 or 204.
- DELETE
- Responsible for DELETEs data from the server.
- If it is success return 200 along with response body.
- If it is failed return 200 or 204.
