Junior — Middle
Can the HTTP protocol be considered a protocol that transmits data in text form or in binary format?
sobes.tech AI
Answer from AI
HTTP is a text-based protocol. It transmits data in the form of text messages, which consist of lines with headers and a request or response body. For example, HTTP requests and responses are made up of ASCII text lines separated by newline characters.
However, the message body (payload) can contain both text and binary data, for example, when transmitting images or files. In this case, the body is encoded in binary format, but the protocol structure itself remains text-based.
Example of an HTTP request:
GET /index.html HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0
Thus, HTTP is a text protocol that can transmit binary data within the message body.