HTTP

Jinhyeon Son·2020년 4월 8일
0

노트

목록 보기
3/8

hypertext = 링크로 연결된 문서

HTTP 각 통신은 독립적임 : stateless
상태를 저장할 수 없기 때문에 앞으로의 통신에 필요한 정보 ex)로그인 토큰 등은
클라이언트에서 저장해야하고 클라이언트가 매 통신에 토큰을 포함해서 요청해야한다

HTTP request의 3부분

  • startline

    	HTTP Method, request target, HTTP version
    	GET /search HTTP/1.1
  • headers

    	Metadata를 위한 영역
    	general headers, request headers, entity headers로 나뉜다
    	key:value 형태로 구성되어있음
    	host, user-agent, accept, connection, content-type, content-length 등
    	로그인 정보 등은 header에 위치한다 (실제 로직과는 관계없기 때문)
  • body

    	해당 request의 실제 메시지

HTTP response의 3부분

  • status line

    	HTTP version, status code, status text
  • headers

    	기본적으로 request의 headers와 같으나 user-agent대신 server 사용
  • body

    request와는 달리 body가 있을수도, 없을수도 있다

https://stackoverflow.com/c/wecode/questions/308
https://stackoverflow.com/c/wecode/questions/121/122#122

0개의 댓글