<aside> 💡

request

response

header

body

</aside>

0.1 HTTP는 “객체”가 아니다

브라우저와 서버는 네트워크 위에서 **바이트(문자)**만 주고받는다.

HTTP는 그 바이트를 어떤 규칙으로 줄 세워 쓰자는 약속이다.

0.2 HTTP 요청(Request) 구조

요청은 크게 4부분이다.

  1. Request Line (요청 시작줄)
  2. Headers (메타데이터)
  3. 빈 줄 (header/body 구분)
  4. Body (실제 데이터)

0.3 GET 요청 예시 (Body 없음)

select * from emp where job = 'salesman';

get -> localhost:8080/emp?job=salesman

get -> localhost:8080/emp/5

select * from emp where empno = 5

브라우저 주소창에서

ip주소:포트/자원명/1

select * from product where id = 1

localhost:8080/product/1