tsndr / cloudflare-worker-router

A super lightweight router (1.0K) with middleware support and ZERO dependencies for Cloudflare Workers.
MIT License
227 stars 30 forks source link

there's no body field in Request #36

Closed jlcastillo closed 1 month ago

jlcastillo commented 7 months ago

The body field is mentioned in the documentation but I didn't see it neither in types nor in the implementation. I wonder how people are getting contents of a POST, PUT, etc.

Kain-90 commented 4 months ago

The tests/index.spec.ts file contains the unit test of describe('Body', () => {, including await req.json(), which can obtain the content in application/json body data. I hope it works for you