Appendix: Formal specifications
HTTP Response := StatusLine + ResponseHeaderLines + EmptyLine + Exact file content
Copyright By Assignmentchef assignmentchef
StatusLine := HTTP/1.0 200 OKr
| HTTP/1.0 404 Not Foundr
| HTTP/1.0 400 Bad Requestr
Header lines
o ResponseHeaderLine := FieldName + : + FieldValue + r
o ResponseHeaderLines := ResponseHeaderLine*
Star (*) means the header line may occur zero or more times
o FieldName is case insensitive
o ResponseHeaderLine Examples:
VALID: Connection: keep-aliver
VALID: connEctIoN: closer
(the field name is case insensitive)
EmptyLine := r
Exact file content (Dont append a line break)
HTTP GET Request := RequestLine + RequestHeaderLines + EmptyLine
RequestLine := GET + Path + HTTP/1.0 + ENDL
o Spaces!!
o RequestLine Examples:
GET /LargeFile.html HTTP/1.0
(line ending:
)
GET /shopping_list.txt HTTP/1.0r
(line ending: r
)
Request header lines
o RequestHeaderLine := FieldName + SP* + : + SP* + FieldValue + ENDL
o RequestHeaderLines := RequestHeaderLine*
o FieldName is case insensitive
o RequestHeaderLine Examples:
VALID: Connection: keep-alive
VALID: connEctIoN:close
(space is optional; field name is case insensitive)
EmptyLine := ENDL
SP :=
ENDL :=
| r
CS: assignmentchef QQ: 1823890830 Email: [email protected]
Reviews
There are no reviews yet.