HTTP 메시지의 구조

yeon·2021년 3월 31일
0

HTTP Request Message의 구조

  1. start line (request line)
  • HTTP 메서드(GET, PUT 등) 서버가 수행해야할 동작

  • request target : 주로 URL

  • HTTP 버전

  1. headers
  • request에 대한 메타 정보를 담고 있으며, key:value 값으로 이루어짐

  • Host : 요청이 전송되는 target의 host url (예: google.com)

  • User-Agent, Accept, Connection, Content-Length 등등

  1. empty line

  2. body모든 요청에 body가 포함되지는 않는다.

  • GET, DELETE와 같이 리소스를 가져오는 요청은 본문이 보통 없다.

  • XML 이나 JSON 데이터가 들어갈 수 있다.

HTTP Response Message의 구조

  1. status line
  • 프로토콜 버전

  • status code : 응답 상태를 나타내는 코드

  • status text : 응답 상태의 설명

  1. headers
  • response에서만 사용되는 header 값이 있다.

  1. empty line

  2. body
    실제 응답하는 데이터



참고자료 : https://developer.mozilla.org/ko/docs/Web/HTTP/Messages https://velog.io/@rosewwross/Http-and-Request-and-Response-hok6exbnfb

0개의 댓글