앞의 그림처럼 ‘curl www.naver.com’이란 명령어를 통해 요청했고 다음과 같은 응답(response) 헤더 값이 나오는데, 이는 모두 문자열인 것을 알 수 있습니다.

     

    출력

    Server: NWS
    Content-Type: text/html; charset=UTF-8
    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    P3P: CP="CAO DSP CURa ADMa TAIa PSAa OUR LAW STP PHY ONL UNI PUR FIN COM NAV INT DEM STA PRE"
    X-Frame-Options: DENY
    X-XSS-Protection: 1; mode=block
    Strict-Transport-Security: max-age=63072000; includeSubdomains
    Referrer-Policy: unsafe-url
    Content-Encoding: gzip
    Content-Length: 59601
    Date: Wed, 26 Jan 2022 05:14:10 GMT
    Connection: keep-alive
    Vary: Accept-Encoding

    참고로 PDU 중 아래 계층인 비트로 송수신하는 것이 모든 PDU 중 가장 빠르고 효율성이 높습니다. 하지만 애플리케이션 계층에서는 문자열을 기반으로 송수신을 하는데, 그 이유는 헤더에 authorization 값 등 다른 값들을 넣는 확장이 쉽기 때문입니다.

    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.