replyWith method
void
replyWith(
- AgEndpoint endpoint,
- Object? json(
- AgRequest request
- AgHttpMethod method = AgHttpMethod.get,
- int statusCode = 200,
- Map<
String, List< headers = const {},String> >
Like reply, but builds the body from each request — to echo a posted body back, or to answer per path parameter.
Implementation
void replyWith(
AgEndpoint endpoint,
Object? Function(AgRequest request) json, {
AgHttpMethod method = AgHttpMethod.get,
int statusCode = 200,
Map<String, List<String>> headers = const {},
}) {
_replies[_key(method, endpoint)] = _Reply(
json: json,
statusCode: statusCode,
headers: headers,
);
}