json<T> method

T? json<T>({
  1. CloudflareJsonDecoder<T>? decode,
})

Provides the declared Cloudflare API member.

Implementation

T? json<T>({CloudflareJsonDecoder<T>? decode}) {
  final value = jsonDecode(text());
  return decode == null ? value as T? : decode(value);
}