HTTP Protocol

박근수·2024년 2월 25일
0

Spring

목록 보기
10/11

HTTP (Hyper Text Transper Protocol)

단순 텍스트가 아닌 하이퍼 텍스트(다른 내용에 대한 링크를 갖는 문자열)을 전송하기 위한 프로토콜(약속된 정의)

HTTP Requesdt 메세지 스펙

  • 첫 째줄 : 요청라인(HTTP 메서드(GET, PUT, POST등)
  • 두 번째줄부터 줄바꿈 나오기 전까지 : Header(User-Agent, Accpet 등)
  • 헤더에서 줄바꿈 이후 : Request Body
POST / account HTTP/1.1
Content-Type : application/json
Accept : application/json
UserInfo : {"userId":34}

{
  "balance" : 5000
}

HTTP Response 메세지 스펙

  • 첫 째줄 : 상태라인 (200, 500 등)
  • 두 번째줄부터 줄바꿈 나오기 전까지 : Header
  • 헤더에서 줄바꿈 이후 : Request Body
HTTP/1.1 200 OK
Content-Type : application/json
Transfer-Encoding : chunked
Date : Sat, 17 Jul 2021 15:33:34 GMT
Keep-Alive : timeout=60
Connection : keep-alive

{
  "developerLevel" : "JUNIOR",
  "developerSkillType" : "FULL_STACK",
  "experiencyYears" : 2,
  "memberId" : "sunny.flo1wer",
  "name" : "sun",
  "age" : 36
}
profile
개발블로그

0개의 댓글