简体   繁体   English

FormatException:输入意外结束(在字符 1 处)^

[英]FormatException: Unexpected end of input (at character 1) ^

i already work with this method and it's working correctly but today i run the same code and i have this error: response message: 500 Internal Server Error I/flutter ( 8784): FormatException: Unexpected end of input (at character 1) I/flutter ( 8784): I/flutter ( 8784): ^我已经使用这种方法并且它工作正常但是今天我运行相同的代码并且我有这个错误:响应消息:500 Internal Server Error I/flutter (8784): FormatException: Unexpected end of input (at character 1) I/颤动(8784):我/颤动(8784):^

Future<String> getCompanies() async {
   try {
     var response = await http.get(Uri.parse(companies), headers: {
       HttpHeaders.authorizationHeader: basicauth,
       HttpHeaders.contentTypeHeader: 'application/json'
     });
     if (mounted) {
       this.setState(() {
         var resbody = JsonDecoder().convert(response.body);
         data = resbody["value"];
       });
     }
   } catch (e) {
     print(e);
   }
 }

Probably causing by charset variation.可能是由字符集变化引起的。 Use CHARSET=utf8 in sqli/pd0 connection.在 sqli/pd0 连接中使用 CHARSET=utf8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 FormatException: 意外的输入结束(在字符 1 处) - FormatException: Unexpected end of input (at character 1) I/flutter:FormatException:输入意外结束(在字符 1 处) - I/flutter : FormatException: Unexpected end of input (at character 1) FormatException:输入意外结束(在字符 2 处)^ 在 flutter - FormatException: Unexpected end of input (at character 2) ^ in flutter 未处理的异常:FormatException:意外的输入结束(在字符 1) - Unhandled Exception: FormatException: Unexpected end of input (at character 1) 未处理的异常:FormatException:输入意外结束(在字符 2 处) - Unhandled Exception: FormatException: Unexpected end of input (at character 2) Fluter json decode FormatException: Unexpected end of input (at character 5) - Getiing Exception in fluter json decode FormatException: Unexpected end of input (at character 5) 如何处理 http 错误 (FormatException: Unexpected end of input (at character 1)) - How to handle http errors (FormatException: Unexpected end of input (at character 1)) FormatException(FormatException:意外字符(在字符 1 处) - FormatException (FormatException: Unexpected character (at character 1) FormatException:意外字符(在字符 1 处) - FormatException: Unexpected character (at character 1) FormatException: JSON 中的意外字符 - FormatException: Unexpected character in JSON
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM