Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振型';无此方法错误';不是类型为';例外情况';_Flutter_Http_Dart_Client - Fatal编程技术网

Flutter 颤振型';无此方法错误';不是类型为';例外情况';

Flutter 颤振型';无此方法错误';不是类型为';例外情况';,flutter,http,dart,client,Flutter,Http,Dart,Client,我正在尝试在修补数据时导航服务器是否响应401。 我已经检查了请求的响应是否通过DevTool收到 Future<void> patchLolBySummonerName(String summonerName) async { try{ final response = await client.patch('${BASE_URL}user/lol', body: {'summonerName': summonerName}); log('resp

我正在尝试在修补数据时导航服务器是否响应401。
我已经检查了请求的响应是否通过DevTool收到

Future<void> patchLolBySummonerName(String summonerName) async {
    try{
      final response = await client.patch('${BASE_URL}user/lol', body: {'summonerName': summonerName});

      log('response code: ${response.statusCode}');

      if(response.statusCode == 200) {
        return;
      }

      NetworkErrorHandler.throwProperException(response);
      return null;
    } catch(e) {
      log('network error: ${e.toString()}');
      throw e;
    }
  }
下面是我通过上面代码记录的日志

[log] network error: type 'NoSuchMethodError' is not a subtype of type 'Exception'
[log] network error: type 'NoSuchMethodError' is not a subtype of type 'Exception'