You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When inserting data using the dart bigquery API the client crashes.
Unhandled exception:ApiRequestError(message:Unable to read response with content-type text/plain; charset=utf-8.)
#0ApiRequester.request (package:_discoveryapis_commons/src/clients.dart:86:9)
<asynchronous suspension>
#1DatasetsResourceApi.insert (package:googleapis/bigquery/v2.dart:234:32)
The problem seems to be that although the response is JSON the Content-Type header is text/plain. You can see the dart code checking for this here:
Stream<String>?_decodeStreamAsText(http.StreamedResponse response) {
// TODO: Correctly handle the response content-types, using correct// decoder.// Currently we assume that the api endpoint is responding with json// encoded in UTF8.if (isJson(response.headers['content-type'])) {
return response.stream.transform(constUtf8Decoder(allowMalformed:true));
} else {
returnnull;
}
}
Would suggest fixing by setting Content-Type: application/json; charset=utf-8 on all JSON responses.
The text was updated successfully, but these errors were encountered:
When inserting data using the dart bigquery API the client crashes.
The problem seems to be that although the response is JSON the
Content-Type
header istext/plain
. You can see the dart code checking for this here:Would suggest fixing by setting
Content-Type: application/json; charset=utf-8
on all JSON responses.The text was updated successfully, but these errors were encountered: