Raid_Manager/app/lib/api/request.dart

14 lines
305 B
Dart
Raw Normal View History

2022-12-06 23:19:10 +00:00
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
dynamic getJson(String uri) async {
2022-12-06 23:19:10 +00:00
if (!kIsWeb) {
uri = "http://127.0.0.1:8000$uri";
}
final resp = await http.get(Uri.parse(uri));
print(resp.body);
2022-12-06 23:19:10 +00:00
return jsonDecode(resp.body);
}