1. HTTP 메세지란?

Server와 Client간 데이터를 교환하는 방법

 

2. HTTP 메세지의 종류

- Request : Client로부터 발송되어 Server에서 동작하는 Message.

- Response : Request에 대한 Server로부터의 응답.

 

3. HTTP 메세지의 특징

- HTTP 메세지는 ASCII로 인코딩된 텍스트 정보로서, 여러 행으로 구성되어 있다.

- HTTP/1.1 혹은 그 이전 버전에서 HTTP 메세지는 정보를 있는 그대로 송신했다.

- HTTP/2 이후부터는 사람이 읽을 수 있던 메세지를 최적화와 성능 향상을 위해 HTTP frames로 분할하여 송신한다.

- 웹 개발자 등이 HTTP 메세지를 만들기도 하는데 설정 파일(프록시 / 서버)이나 API(브라우저) 혹은

  다른 인터페이스를 통해 제공한다.

4. HTTP 메세지의 구조

- Start-line : 실행할 요청 혹은 요청에 대한 성공, 실패 여부를 나타내며, 항상 한 줄이다.

- Headers : 요청, 응답 그 자체나 메세지 내의 본문에 대하여 설명한다.

- Blank line : 요청, 응답에 대한 모든 메타 정보가 송신되었음을 의미한다.

- Body : 요청에 관한 데이터나 응답에 관한 문서를 포함한다.

           Body의 유무나 사이즈 등 설명은 Start-line과 Headers에 있다.

5. HTTP Request

- Start line : 다음 세 가지 요소를 포함한다.

    1) HTTP Method : Server에서 수행될 동작을 동사(GET, PUT or POST)나 명사(HEAD or OPTIONS)로 설명한다.

                           예를 들어, GET은 자원을 가져오는 것, POST는 데이터를 서버에 보내는 것을 의미한다.

    2) Request Target : 요청할 대상을 URL, 절대 경로 등으로 지정하며 HTTP Methods에 따라 포맷이 다르다.

            (1) an Absolute path : 가장 일반적인 포맷으로 GET, POST, HEAD, OPTIONS 메서드와 함께 사용된다.

                 OPTIONS methods.

                   - POST / HTTP/1.1

                   - GET /background.png HTTP/1.0

                   - HEAD /test.html?query=alibaba HTTP/1.1

                   - OPTIONS /anypage.html HTTP/1.0

            (2) A Complete URL : 주로 Proxy에 연결할 때 GET 메서드와 함께 사용된다.

                 GET http://developer.mozilla.org/en-US/docs/Web/HTTP/Messages

                 HTTP/1.1

            (3) The authority form

                 : HTTP 터널 기동 시, 오직 CONNECT 메서드와 사용되는 포맷으로, 도메인명과 포트번호를 포함한다.

                 CONNECT developer.mozilla.org:80 HTTP/1.1

            (4) The asterisk form : OPTION 메서드와 함께 사용되며, *는 서버 전체를 나타낸다.

                 OPTIONS * HTTP/1.1

    3) HTTP Version : 뒤에 올 메세지의 구조를 정의한다.

- Headers : 콜론( : )이 따라붙는 대소문자 구분 없는 문자열과 헤더에 따라 다른 값으로 구성된다.

               헤더는 한 줄 단위이며 꽤나 길어질 수 있고, 다음과 같은 그룹으로 나눌 수 있다.

    1) General Headers : via는 메세지 전체에 적용된다.

    2) Request Headers : User-Agent, Accept-Type와 같은 헤더는 요청을 구체화하고(Accept-Language),

                                컨텍스트를 제공하거나(Referer), 조건에 따라 제약을 가한다(If-None).

    3) Entity Headers : Content-Length와 같은 헤더는 Body에 적용되고, 요청 내에 Body가 없는 경우 전송되지 않는다.

- Body

 

6. HTTP Response

- Start line

- Headers

- Body

 

7. HTTP/2 Frames

 

8. 요약

 

9. 모르는 영단어

[명사]

Continuation : a situation in which something continues without stopping.

Alteration : a change in the appearance or form of something.

Presence : the existence of someone or something in a particular place.

Existence : the state of being a real or living thing, or of being present in a particular place, time, or situation.

Context : the general situation in which something happens, which helps to explain it.

 

[형용사]

Case-sensitive : a case-sensitive computer program is able to recognize the difference

                    between the large forms of letters, A, B, C etc and their and small forms, a, b, c etc

 

[동사]

Specify : to explain something in an exact and detailed way.

Fetch : to go and get something.

Vary : to be different in different situations.

Set up : to start something such as a business, organization, or institution.

 

[전치사]

Via : going through one place on the way to another place.

 

출처 : developer.mozilla.org/en-US/docs/Web/HTTP/Messages

 

HTTP Messages

HTTP messages are how data is exchanged between a server and a client. There are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server.

developer.mozilla.org

반응형

'■ 웹 개발 > 프로토콜' 카테고리의 다른 글

HTTP의 진화  (0) 2020.10.15
HTTP의 개요  (0) 2020.10.15

+ Recent posts