[{"id":"httpbeginner-001","courseId":"http-beginner","domain":"messages-and-syntax","topic":"Request line parts","prompt":"A client sends this request. Which part of the request line is the request target?","hint":"Work out which part names the resource the method acts on.","explain":"Every HTTP/1.x request starts with a request line of three parts separated by spaces. Each part tells the server something different about the request.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2","interaction":{"type":"single"},"options":[{"id":"a","text":"/docs/intro","why":"The request-target identifies the target resource the request applies to; it is the middle part of the request line."},{"id":"b","text":"GET","whyNot":"That is the method, the first part, which says what the client wants done."},{"id":"c","text":"HTTP/1.1","whyNot":"That is the protocol version, the last part of the request line."},{"id":"d","text":"GET /docs/intro HTTP/1.1","whyNot":"That is the whole request line, not one of its three parts."}],"answer":"a","explanation":"An HTTP/1.x request-line is method, request-target and protocol, in that order, separated by spaces.","concept":"An HTTP/1.x request-line is method, request-target and protocol, in that order, separated by spaces.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","code":"GET /docs/intro HTTP/1.1\nHost: example.com","takeaways":["The request line is method, then request target, then protocol version."]},{"id":"httpbeginner-002","courseId":"http-beginner","domain":"messages-and-syntax","topic":"Status line parts","prompt":"A response's status line writes the version as http/1.1 in lowercase. The version name is case-insensitive, so this means the same as HTTP/1.1.","hint":"Think about whether the spec treats the version text as exact characters.","explain":"The start-line of an HTTP/1.x message carries a version field. That field follows a fixed grammar, and the grammar decides how strictly its characters must match.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-4","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"The version name is case-sensitive, so lowercase http does not match the HTTP name the grammar requires."},{"id":"b","text":"False","why":"HTTP-version is case-sensitive, so http/1.1 is not written the way the grammar requires."}],"answer":"b","explanation":"HTTP-version is case-sensitive: the name is HTTP in uppercase, then a slash and two digits separated by a dot.","concept":"HTTP-version is case-sensitive: the name is HTTP in uppercase, then a slash and two digits separated by a dot.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Write the version as HTTP/1.1 in uppercase; the version name is case-sensitive."]},{"id":"httpbeginner-003","courseId":"http-beginner","domain":"messages-and-syntax","topic":"Header field line format","prompt":"A teammate hand-writes an HTTP/1.1 request in a test file. Which sequence must end each header field line?","hint":"Consider the terminator the spec defines, not what Unix text files usually use.","explain":"Each header field line in a message ends with a defined line terminator. Recipients are allowed some leniency, but senders follow one fixed rule for what they write.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-5","interaction":{"type":"single"},"options":[{"id":"a","text":"CRLF (carriage return, then line feed)","why":"The spec makes CRLF the line terminator for the start-line and for each field line."},{"id":"b","text":"A single LF on its own","whyNot":"A recipient may accept a bare LF, but the defined terminator is CRLF."},{"id":"c","text":"A single CR on its own","whyNot":"A sender must not generate a bare CR outside the message content."},{"id":"d","text":"A colon followed by a space","whyNot":"The colon separates a field name from its value; it does not end the line."}],"answer":"a","explanation":"The line terminator for the start-line and header field lines is the sequence CRLF; recipients may tolerate a bare LF.","concept":"The line terminator for the start-line and header field lines is the sequence CRLF; recipients may tolerate a bare LF.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Header lines end with CRLF; a sender must never write a bare CR."]},{"id":"httpbeginner-004","courseId":"http-beginner","domain":"messages-and-syntax","topic":"Blank line ending the header section","prompt":"A recipient reads an HTTP/1.x message as a stream of bytes. Put these steps of its normal parsing procedure in order.","hint":"Consider what the parser needs to know before it can tell whether a body follows.","explain":"Parsing an HTTP/1.x message is a chain of decisions, each resting on information gathered earlier. Framing rules set how many bytes belong to a message, so they can apply only once the needed fields are read.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-2.1","interaction":{"type":"sort","items":[{"text":"Read the start-line into a structure","why":"Parsing starts with the first line, which describes the request or the response."},{"text":"Read header field lines into a table by field name, until the empty line","why":"Headers come next, and the blank line marks where the header section ends."},{"text":"Use the parsed data to decide whether a message body is expected","why":"Only the start-line and headers tell the parser whether a body exists and how long it is."},{"text":"If a body is indicated, read it as a stream until its length is reached or the connection closes","why":"The body comes last, since it is read only after the headers say one exists."}]},"options":[],"answer":"o:abcd","explanation":"Parsing reads the start-line, then the header fields up to the empty line, then uses them to decide whether and how to read the body.","concept":"Parsing reads the start-line, then the header fields up to the empty line, then uses them to decide whether and how to read the body.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["The blank line ends the headers; only then can the parser decide on a body."]},{"id":"httpbeginner-005","courseId":"http-beginner","domain":"messages-and-syntax","topic":"Host header requirement","prompt":"A client prepares an HTTP/1.1 request to a web server. Which header must it always include so the server knows which site is meant?","hint":"Think about how many websites can share one IP address.","explain":"Many sites can share one IP address, and older clients assumed one address meant one server. HTTP/1.1 needed a way for each request to name its intended site.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2","interaction":{"type":"single"},"options":[{"id":"a","text":"Host","why":"HTTP/1.1 requests must send Host so the server knows which host the request is for."},{"id":"b","text":"Content-Type","whyNot":"It describes the media type of a body; it does not name the target site."},{"id":"c","text":"Accept","whyNot":"It lists the response formats the client can handle, not the target site."},{"id":"d","text":"Content-Length","whyNot":"It gives a body's size in bytes; it does not name the target site."}],"answer":"a","explanation":"HTTP/1.1 requests must include a Host header field, which names the host the request is for.","concept":"HTTP/1.1 requests must include a Host header field, which names the host the request is for.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Every HTTP/1.1 request needs a Host header, even when the target is a full URL."]}]