Raid_Manager/app/lib/api/request.dart
2022-12-09 12:50:58 +01:00

14 lines
305 B
Dart

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