readBody method

Future<String> readBody()

Reads the request body as a string.

Use this for form data or JSON payloads.

final body = await request.readBody();
final data = jsonDecode(body);

Implementation

Future<String> readBody() => shelfRequest.readAsString();