Junior — Middle
What protocols are used for data exchange in REST API?
sobes.tech AI
Answer from AI
Data exchange in REST API is usually carried out over the HTTP or HTTPS protocol. REST (Representational State Transfer) is an architectural style that uses standard HTTP methods (GET, POST, PUT, DELETE, etc.) for interaction between the client and the server.
Thus, the main protocols are:
- HTTP — for transmitting data in plain text.
- HTTPS — a secure version of HTTP using SSL/TLS for data encryption.
Example: the client sends an HTTP request to the server, and the server responds with data in JSON or XML format.