this is the form of the API endpoint enter image description here
when I send a post request it always fails, then I try to only send text without pictures and it works. with data accommodated through the model. i have service api code like this :
Future<RekomModel> createRekom(RekomModel data, int id) async {
try {
final token = await AuthService().getToken();
final res = await http.post(
Uri.parse('$baseUrl/rekomendasi-penilaian/$id/store'),
headers: {
'Authorization': token,
},
body: data.toJson(),
);
if (res.statusCode == 200) {
RekomModel uploadData = RekomModel.fromJson(jsonDecode(res.body));
return uploadData;
} else {
throw jsonDecode(res.body)['message'];
}
} catch (e) {
rethrow;
}
}
how do i solve this well, what should i change in my code