reply method
void
reply(
- AgEndpoint endpoint, {
- AgHttpMethod method = AgHttpMethod.get,
- Object? json,
- int statusCode = 200,
- Map<
String, List< headers = const {},String> >
Answers method requests to endpoint with json, decoded by the
caller's decode exactly as a real response body would be. A
statusCode outside 2xx throws an AgApiException carrying json
as its responseBody, as the real provider does.
Implementation
void reply(
AgEndpoint endpoint, {
AgHttpMethod method = AgHttpMethod.get,
Object? json,
int statusCode = 200,
Map<String, List<String>> headers = const {},
}) {
replyWith(
endpoint,
(_) => json,
method: method,
statusCode: statusCode,
headers: headers,
);
}