(해석 또는 이해가 잘못된 부분이 있다면 댓글로 편하게 알려주세요.)
Now let’s take a quick look at the structure of HTTP request and response messages. We’ll study HTTP messages in exquisite detail in Chapter 3.
-> 이제 HTTP의 Request와 Response 메시지 구조를 빠르게 살펴봅시다.
-> HTTP 메시지의 자세한 부분은 Chapter 3에서 다룹니다.
HTTP messages are simple, line-oriented sequences of characters. Because they are plain text, not binary, they are easy for humans to read and write.* Figure 1-7 shows the HTTP messages for a simple transaction.
-> HTTP 메시지는 단순한 행 단위 문자열입니다.
-> HTTP 메시지는 이진수가 아닌 순수한 텍스트이기 때문에 인간이 읽고 쓰는 데 최적화되어 있습니다.
-> Figure 1-7은 간단한 트랜잭션에서의 HTTP 메시지를 보여줍니다.
HTTP messages sent from web clients to web servers are called request messages. Messages from servers to clients are called response messages. There are no other kinds of HTTP messages. The formats of HTTP request and response messages are very similar.
-> Request 메시지는 웹 클라이언트로부터 웹 서버로 전달되는 HTTP 메시지입니다.
-> Response 메시지는 웹 서버로부터 웹 클라이언트로 전달되는 HTTP 메시지입니다.
-> 이들을 제외한 다른 HTTP 메시지는 없습니다.
-> HTTP Request와 Response 메시지의 형태는 매우 흡사합니다.
HTTP messages consist of three parts:
Start line
The first line of the message is the start line, indicating what to do for a request or what happened for a response.
-> HTTP 메시지는 3가지 부분으로 구성되어 있습니다.
Header fields
Zero or more header fields follow the start line. Each header field consists of a name and a value, separated by a colon (:) for easy parsing. The headers end with a blank line. Adding a header field is as easy as adding another line.
Body
After the blank line is an optional message body containing any kind of data. Request bodies carry data to the web server; response bodies carry data back to the client. Unlike the start lines and headers, which are textual and structured, the body can contain arbitrary binary data (e.g., images, videos, audio tracks, software applications). Of course, the body can also contain text.
Figure 1-8 shows the HTTP messages that might be sent as part of a simple transaction. The browser requests the resource http://www.joes-hardware.com/tools.html.
-> Figure 1-8은 간단한 트랜잭션 과정에서 전송되었을 HTTP 메시지를 보여줍니다.
-> 브라우저는 http://www.joes-hardware.com/tools.html에 리소스를 요청합니다.
In Figure 1-8, the browser sends an HTTP request message. The request has a GET method in the start line, and the local resource is /tools.html. The request indicates it is speaking Version 1.0 of the HTTP protocol. The request message has no body, because no request data is needed to GET a simple document from a server.
-> Figure 1-8에서, 브라우저는 HTTP Request 메시지를 전송합니다.
-> Start Line에서는 이 요청이 GET 메소드라는 점과 서버의 로컬 리소스가 /tools.html이라는 점, HTTP/1.0 프로토콜을 사용하고 있다는 점을 나타냅니다.
-> 이 Request 메시지에는 body가 존재하지 않습니다. 서버로부터 간단한 문서를 GET 해오는 데는 요청 데이터가 전혀 필요없기 때문입니다.
The server sends back an HTTP response message. The response contains the HTTP version number (HTTP/1.0), a success status code (200), a descriptive reason phrase (OK), and a block of response header fields, all followed by the response body containing the requested document. The response body length is noted in the Content-Length header, and the document’s MIME type is noted in the Content-Type header.
-> 서버는 HTTP Response 메시지를 반환합니다.
-> 해당 Response는 HTTP의 버전 정보(HTTP/1.0), Status Code(200)와 사유 구절(OK), header fields 블록을 비롯하여 요청받은 문서를 포함한 Response Body를 가지고 있습니다.
-> Response Body의 길이는 Content-Length 헤더에 명시되고 문서의 MIME 타입은 Content-Type 헤더에 명시됩니다.