Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/littledivy/picohttpparser_deno
Fast, low overhead bindings to picohttpparser HTTP parser in Deno
https://github.com/littledivy/picohttpparser_deno
deno fast ffi http picohttpparser
Last synced: 3 months ago
JSON representation
Fast, low overhead bindings to picohttpparser HTTP parser in Deno
- Host: GitHub
- URL: https://github.com/littledivy/picohttpparser_deno
- Owner: littledivy
- Created: 2022-09-09T06:36:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-09T08:07:11.000Z (over 2 years ago)
- Last Synced: 2024-10-04T17:38:20.215Z (4 months ago)
- Topics: deno, fast, ffi, http, picohttpparser
- Language: C
- Homepage:
- Size: 29.3 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## `picohttpparser` in Deno
```typescript
import { parseRequest } from "https://deno.land/x/picohttpparser/mod.ts";let h0 = encode(`GET / HTTP/1.1\r\nContent-Length: 13\r\n\r\nHello, World!`);
let req = parseRequest(h0);while (req.isPartial) {
// Read more bytes from _somewhere_
h0 = read();
req = parseRequest(h0);
}req.method; // "GET"
req.url; // "/"
req.body; // null
```![image](https://user-images.githubusercontent.com/34997667/189287994-7ab35925-f118-4110-a035-22dceaf95c6b.png)