bodyAsText method

Future<String> bodyAsText (
  1. [Encoding encoding = conv.utf8]
)

Returns body as text

Example: final server = new Jaguar(); server.post('/api/book', (Context ctx) async { // Decode request body as JSON Map final String body = await ctx.req.bodyAsText(); // ... }); await server.serve();

Implementation

Future<String> bodyAsText([conv.Encoding encoding = conv.utf8]) async {
  return encoding.decode(await body);
}