fetchText method

Future<void> fetchText({
  1. required String url,
  2. required dynamic onOk(
    1. String e
    ),
  3. required dynamic onException(
    1. String e
    ),
})

Implementation

Future<void> fetchText({
  required String url,
  required Function(String content) onOk,
  required Function(String e) onException,
}) async {
  await UHttpClient.send(
    method: "GET",
    endpoint: url,
    onSuccess: (Response r) => onOk(r.body),
    onError: (Response r) => onException(r.body),
    onException: onException,
  );
}