- Read Config Files
- Open a Socket to listen at a Port
- Read Request Headers and Messages(Body)
- Open and read the files from the File-system
- Write and send back the Response Messages
= start-line *(header-field CRLF) CRLF [ message-body ]
The recipient must parse an HTTP message as a sequence of octets in an encoding that is a superset of ASCII.
start-line = request-line / status-line
The request line consists of - method_request-target_HTTP-version CRLF method - is case-sensitive as it is a token. method type - GET, POST, HEAD, PUT, DELETE, CONNECT, OPTIONS, TRACE. request-target - is the target on which the request is to be applied.
Types -
- Lexer Parser - Stream -> Token -> Method+URI+Version
- Lexer less Parser - Stream -> Method+URI+Version
HTTP-Message - It is indicated by HTTP-Version field in the 1st line of message. HTTP-Version is case-sensitive. HTTP-Version = HTTP-Name "/" DIGIT ":" DIGIT HTTP-Name = %x48.54.54.50 : "HTTP", case-sensitive The first 2 decimal numbers indicate major and minor version. Major's minor is indicated and in minor version back-ward compatibility is shown as subset of protocol, lets the recipient use more advanced features can be used in response or in future requests.
- header-field = field-name ":" OWS field-value OWS
- field-name = token(this token labels the corresponding field-value as having the semantics defined by header field)
- field-value = * (field-content / obs-fold)
- field-content = field-vchar [ 1*(SP/HTAB) field-varchar]
- field-vchar = VCHAR/ obs-text
- obs-text = CRLF 1* (SP/HTAB) ; obsolete line folding ;
Token = 1 * tchar
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "|" / "~" / DIGIT / ALPHA ; any VCHAR, except delimiters