handler abstract method

Future handler(
  1. SparkRequest request
)

Handles incoming requests.

The return type can be:

  • String: Returned as plain text with content-type: text/plain
  • Custom object with toJson(): Serialized to JSON
  • List, Map, primitives: Serialized to JSON
  • Response: Returned directly

Implementation

Future<dynamic> handler(SparkRequest request);