Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)