You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/roadmap/phase-2/stage-14.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,11 @@ Content-Length: 123
29
29
30
30
The first line contains the HTTP request line. On parsing the following information is retrieved
31
31
32
-
Method: GET
32
+
Method: `GET`
33
33
34
-
URI/Path: /index.html
34
+
URI/Path: `/index.html`
35
35
36
-
HTTP Version: HTTP/1.1
36
+
HTTP Version: `HTTP/1.1`
37
37
38
38
2.**Header Parsing**
39
39
@@ -146,14 +146,14 @@ A struct `xps_http_req_s` is introduced, which stores the information retrieved
146
146
147
147
-`parser_state`: Holds the current state of the HTTP request parsing process.
148
148
-`method_n`: Stores the parsed HTTP method (HTTP_POST, etc.).
149
-
-`request_line`: Holds the full request line, such as POST https://www.devdiary.live:3000/api/problems HTTP/1.1.
149
+
-`request_line`: Holds the full request line, such as `POST https://www.devdiary.live:3000/api/problems HTTP/1.1`.
150
150
-`method`: Stores the HTTP method (e.g., POST).
151
-
-`uri`: Holds the full URI (e.g., https://www.devdiary.live:3000/api/problems?key=val).
151
+
-`uri`: Holds the full URI (e.g., `https://www.devdiary.live:3000/api/problems?key=val`).
152
152
-`schema`: Stores the URI schema (e.g., https).
153
-
-`host`: Stores the host part of the URI (e.g., www.devdiary.live).
153
+
-`host`: Stores the host part of the URI (e.g., `www.devdiary.live`).
154
154
-`port`: Stores the port number extracted from the URI (e.g., 3000).
155
-
-`path`: Contains the full path (e.g., /api/problems?key=val).
156
-
-`pathname`: Contains just the path without any query parameters (e.g., /api/problems).
155
+
-`path`: Contains the full path (e.g., `/api/problems?key=val`).
156
+
-`pathname`: Contains just the path without any query parameters (e.g., `/api/problems`).
157
157
-`http_version`: Stores the HTTP version (e.g., 1.1). `http_major` and `http_minor` point to the start of the major and minor version numbers in the buffer.
158
158
-`headers`: Holds the parsed headers. Each header will be stored as a key-value pair in this vector.
159
159
-`header_key_start`, `header_key_end`, `header_val_start`, `header_val_end`: These pointers are used during header parsing to mark the start and end of the key and value of each header.
As in the previous file server implementation, the file to be opened should be present in the public folder.
1003
1003
1004
-
We can verify the modification by requesting the file through browser. Start the server and in browser, enter http request message for getting the file. For eg: http://localhost:8001/sample.txt . Here, sample.txt is the file to be opened and it is present in the public folder. Verify that the contents of file are displayed in browser.
1004
+
We can verify the modification by requesting the file through browser. Start the server and in browser, enter http request message for getting the file. For eg: `http://localhost:8001/sample.txt` . Here, sample.txt is the file to be opened and it is present in the public folder. Verify that the contents of file are displayed in browser.
1005
1005
1006
1006
Now try how the browser responds if the file is not present in public folder.
0 commit comments