Junior — Middle
Can you explain what the HTTP GET method is?
sobes.tech AI
Answer from AI
The HTTP GET method is used to request data from a server. It is intended for retrieving information without modifying the state of the resource on the server.
Main characteristics of GET:
- Safe: should not modify data on the server
- Idempotent: repeated requests do not change the result
- Can contain parameters in the URL (query string)
Example of a GET request:
GET /users?id=123 HTTP/1.1
Host: example.com
The server responds with the requested data, such as information about the user with id=123.
GET is widely used for loading pages, retrieving API data, etc.