in reply to Re^2: Getting error while decoding JSON object via POST method
in thread Getting error while decoding JSON object via POST method

This error message occurs when you pass the empty string or an undefined variable to be decoded by JSON, JSON::PP or JSON::XS.

So I'd suggest that even with the updated code, the problem is related to the initialization of $jsonText - it appears to be undef.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name