Getting bad request when uploading taining file (Futter)

Sending the followin request I get a 400 BAD REQUEST

how can I find aout what is going wrong?

Map<String, String> body = {
      'file' : 'trainingData.jsonl',
      'purpose' : 'fine-tune'
    };

    final http.MultipartFile multiPartFile = await http.MultipartFile.fromPath("file", file.path);

    final http.MultipartRequest request = http.MultipartRequest(
      "POST",
      Uri.parse('https://api.openai.com/v1/files'),
    );
    request.headers['Authorization'] = 'Bearer %MYAPIKEY%';
    request.headers['Accept'] = 'application/json';
    request.headers['content-type'] = 'application/json';
    request.files.add(multiPartFile);
    request.fields.addAll(body);

the problem was with the formatting in the JSONL