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
{{ message }}
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
Parse HTTP message (Request and Response) from raw string in Node.JS
7
+
Parse HTTP messages (Request and Response) from raw string in Node.JS
8
8
9
-
##Parse HTTP Message
9
+
##Parse HTTP Messages
10
10
```javascript
11
11
var parser =require('http-string-parser');
12
12
13
-
message =parser.parse(string);
13
+
request =parser.parseRequest(requestString);
14
+
response =parser.parseResponse(responseString);
14
15
15
-
console.log(message['request']);
16
-
console.log(message['response']);
16
+
console.log(request);
17
+
console.log(response);
17
18
```
18
19
19
20
See more about [Request][request] and [Response][response] data model.
@@ -35,4 +36,4 @@ See more about [Request][request] and [Response][response] data model.
35
36
36
37
- - -
37
38
38
-
NOTE: Proof of concept, naive HTTP parsing, wheel re-inventation. In future it may be replaced with better parser from [Node.JS core's C bindings of NGINX HTTP parser](https://github.com/joyent/http-parser)
39
+
NOTE: Proof of concept, naive HTTP parsing, wheel re-inventation. In future it may be replaced with better parser from [Node.JS core's C bindings of NGINX HTTP parser](https://github.com/joyent/http-parser)
0 commit comments