본문 바로가기
다양한 TIP

HTTP Startline 문법 확인

by 유기농프로그래밍 2022. 11. 3.
반응형

HTTP RFC 2616의 내용을 참고했습니다.

HTTP Start-line에 관한 문법이 맞는지 확인할 때 참고하시면 좋을 것 같습니다.

 

Start-Line 이란?

Request의 Request-Line 과 Response의 Status-Line 로 칭해지며, 각각 Payload의 첫번째 줄을 의미합니다.

 

 

Request(Request-Line)

Request-Line = Method SP Request-URI SP HTTP-Version CRLF

 

Method = "OPTIONS"

                      | "GET"
                      | "HEAD"
                      | "POST"
                      | "PUT"
                      | "DELETE"
                      | "TRACE"
                      | "CONNECT"
                      | extension-method
extension-method = token

 

Request-URI = "*" | absoluteURI | abs_path | authority

HTTP-Version  = "HTTP" "/" 1*DIGIT "." 1*DIGIT

 

Response(Status-Line)

Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

 

HTTP-Version  = "HTTP" "/" 1*DIGIT "." 1*DIGIT

 

Status-Code =
            "100"
          | "101"
          | "200"
          | "201"
          | "202"
          | "203"
          | "204"
          | "205"
          | "206"
          | "300"
          | "301"
          | "302"
          | "303"
          | "304"
          | "305"
          | "307"
          | "400"
          | "401"
          | "402"
          | "403"
          | "404"
          | "405"
          | "406"
          | "407"
          | "408"
          | "409"
          | "410"
          | "411"
          | "412"
          | "413"
          | "414"
          | "415"
          | "416"
          | "417"
          | "500"
          | "501"
          | "502"
          | "503"
          | "504"
          | "505"
          | extension-code

extension-code = 3DIGIT

 

Reason-Phrase  = *<TEXT, excluding CR, LF>

 

TEXT = <any OCTET except CTLs,
                        but including LWS>

CTL = <any US-ASCII control character
                        (octets 0 - 31) and DEL (127)>
LWS = [CRLF] 1*( SP | HT )
CR = <US-ASCII CR, carriage return (13)>
LF = <US-ASCII LF, linefeed (10)>
SP = <US-ASCII SP, space (32)>
HT = <US-ASCII HT, horizontal-tab (9)>
OCTET = <any 8-bit sequence of data>

반응형

댓글