AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Added PUT method support to RestApiUtility
hunteraraujo5f4454737d64
diff --git a/frontend/lib/utils/rest_api_utility.dart b/frontend/lib/utils/rest_api_utility.dartindex 18e29509ca..889fa7f4d5 100644--- a/frontend/lib/utils/rest_api_utility.dart+++ b/frontend/lib/utils/rest_api_utility.dart@@ -54,6 +54,24 @@ class RestApiUtility {}}+ Future<Map<String, dynamic>> put(+ String endpoint, Map<String, dynamic> payload,+ {ApiType apiType = ApiType.agent}) async {+ final effectiveBaseUrl = _getEffectiveBaseUrl(apiType);+ final response = await http.put(+ Uri.parse('$effectiveBaseUrl/$endpoint'),+ body: json.encode(payload),+ headers: {"Content-Type": "application/json"},+ );+ if (response.statusCode == 200 || response.statusCode == 201) {+ return json.decode(response.body);+ } else {+ print(response.statusCode);+ print(response.body);+ throw Exception('Failed to update data with PUT request');+ }+ }+Future<Uint8List> getBinary(String endpoint,{ApiType apiType = ApiType.agent}) async {final effectiveBaseUrl = _getEffectiveBaseUrl(apiType);