rawleyfowler / Humming-Bird

A fun and performant web application framework for Raku
MIT License
44 stars 6 forks source link

Add infered content #47

Closed rawleyfowler closed 1 year ago

rawleyfowler commented 1 year ago

Fixes #46

This allows the user to instantly convert JSON and urlencoded bodies to Raku Maps:

use Humming-Bird::Core;

post('/', -> $request, $response {
    my %body = $request.content; # This will be an empty map if the body is not able to be parsed.
    $response.write(%body.Str);
});