This is my code, I'm getting weird exception, I don't know what is wrong. I'm using Microsoft Translator API and trying to send requests with Dart http package, I tried connecting to different endpoint and it worked. Something fails when the program tries to get the response with client.post method.

Future<List<String>> microsoftTranslatorDictionaryLookup(
    {required String input, required String from, required String to}) async {
  // Checking if the parameters are correct
  if (from != "pl" && from != "en") {
    throw Exception(
        "'from' parameter inside microsoftTranslatorDictionaryLookup function does not match any supported languages");
  }
  if (to != "pl" && to != "en") {
    throw Exception(
        "'to' parameter inside microsoftTranslatorDictionaryLookup function does not match any supported languages");
  }

  // package:http/retry.dart provides a class RetryClient to wrap an underlying http.Client which transparently retries failing requests.
  // By default, this retries any request whose response has status code 503 Temporary Failure up to three retries.
  // It waits 500ms before the first retry, and increases the delay by 1.5x each time.
  // All of this can be customized using the RetryClient() constructor.
  var client = RetryClient(http.Client());
  // If the request fails, the app won't crash
  try {
    // URL of the http request, the 'to' and 'from' parameters are pased in the URL of the request
    var url = Uri.parse(
        "https://microsoft-translator-text.p.rapidapi.com/Dictionary/Lookup?to=$to&api-version=3.0&from=$from");
    // The response of the API
    var response = await client.post(url,
        // The headers of http request
        headers: {
          "X-Rapidapi-Key":
              "",
          "X-Rapidapi-Host": "microsoft-translator-text.p.rapidapi.com",
          "content-type": "application/json"
        },
        // The body of http request (as JSON)
        body: """[{"Text": "$input"}]""");
    // Decoding the response from JSON, and getting the translations
    var responseDecoded = jsonDecode(response.body)[0]["translations"];

    // result is a list of strings fetched from the response
    List<String> result = [];
    for (var i in responseDecoded) {
      result.add(i["normalizedTarget"]);
    }
    return result;

  } finally {
    // Closing the client
    client.close();
  }
}

void main() async {
  var x = await microsoftTranslatorDictionaryLookup(
      input: "Dzień", from: "pl", to: "en");
  for (var i in x) {
    print(i);
  }
}

Excpetion:

Unhandled exception:
FormatException: Filter error, bad data
#0      _FilterImpl.processed (dart:io-patch/filter_patch.dart:12:69)
#1      _FilterSink.addSlice (dart:io/data_transformer.dart:505:29)
#2      _FilterSink.add (dart:io/data_transformer.dart:489:5)
#3      _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#4      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#5      _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#6      CastStreamSubscription._onData (dart:_internal/async_cast.dart:85:11)
#7      _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#10     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#11     _HandleErrorStream._handleData (dart:async/stream_pipe.dart:253:10)
#12     _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
#13     _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#14     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#15     _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#16     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
#17     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
#18     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#19     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#20     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#21     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:405:11)
#22     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#23     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)