草庐IT

bad_cast

全部标签

json - 发生异常 : type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>' in type cast

您好,我正在学习flutter并从api获取json,但是在我的模型中对其进行解码时,出现下面列出的错误。我知道这与我的分页有关,因为定位结果很好,但无法弄清楚我需要做什么来修复分页结果。我尝试了很多教程,但没有运气。谁能指出我正确的方向以解决此问题?提前致谢错误Exceptionoccured:type'_InternalLinkedHashMap'isnotasubtypeoftype'List'intypecast*location.dartclassLocations{finalStringid;finalStringname;finalStringstreet;finalSt

【Vue3】发送post请求出现400 Bad Request 报错

查了一下网上资料,报400一般无非就是两种:1.BadRequest:“错误的请求"2.InvalidHostname:"不存在的域名”在这里我的报错是因为前端请求头的content-type和后端不一致。一般后端默认的内容类型是application/x-www-form-urlencoded,而axios默认的是 applecation/json。但是也有例外,要根据后端的注解来区分我们要转换的类型。根据上一篇笔记上说的:@RequestBody用content-type= application/json @RequestParam用 content-type=application/x

android - Flutter FAILURE : Build failed with an exception. FormatException: Bad UTF-8 encoding 0xfd (at offset 52)

当我尝试在VsCode中运行我的flutter应用程序时。我遇到了这个错误。在我最近的应用程序中,一切正常。在这个应用程序中,我只完成了添加firebase连接。在flutterdoctor中有没有错误,也没有使用土耳其语字符。 最佳答案 已解决。这是因为我在程序文件中构建了flutter文件夹。你不应该那样做。 关于android-FlutterFAILURE:Buildfailedwithanexception.FormatException:BadUTF-8encoding0xfd

android - Flutter FAILURE : Build failed with an exception. FormatException: Bad UTF-8 encoding 0xfd (at offset 52)

当我尝试在VsCode中运行我的flutter应用程序时。我遇到了这个错误。在我最近的应用程序中,一切正常。在这个应用程序中,我只完成了添加firebase连接。在flutterdoctor中有没有错误,也没有使用土耳其语字符。 最佳答案 已解决。这是因为我在程序文件中构建了flutter文件夹。你不应该那样做。 关于android-FlutterFAILURE:Buildfailedwithanexception.FormatException:BadUTF-8encoding0xfd

http - 未处理的异常 : type 'List<String>' is not a subtype of type 'String' in type cast

我正在尝试在我的api中发布一个字符串列表。以下是我的网络代码classDashboardFeeCountApiProviderimplementsDashboardFeeCountSource{@overrideFuturegetDashboardFees(Stringtype,StringuserId,StringyearId,ListfeeCategoryId)async{finalresponse=awaithttp.post(DASHBOARD_FEE_URL,body:{"type":"1","userid":userId,"yearId":yearId,"fee_cat_

http - 未处理的异常 : type 'List<String>' is not a subtype of type 'String' in type cast

我正在尝试在我的api中发布一个字符串列表。以下是我的网络代码classDashboardFeeCountApiProviderimplementsDashboardFeeCountSource{@overrideFuturegetDashboardFees(Stringtype,StringuserId,StringyearId,ListfeeCategoryId)async{finalresponse=awaithttp.post(DASHBOARD_FEE_URL,body:{"type":"1","userid":userId,"yearId":yearId,"fee_cat_

Nginx 502 Bad Gateway 错误的原因及解决方法

Nginx502BadGateway错误的原因及解决方法多数是后端问题也就是PHP的问题,简单的情况可以刷新(不是一般的刷新哦,Ctrl+F5 强制刷新)解决。在php服务当中,有两个参数非常的重要:max_requestst和max_children,具体的原因必须要查看日志才可以弄明白!1、检查PHP基础设置修改/www/server/php/80/etc/php-fpm.confrequest_terminate_timeout=100 ,把100改成5;php执行超时,修改/usr/local/php/etc/php.ini将max_execution_time 为300;2、Fast

Unable to tunnel through proxy. Proxy returns “HTTP/1.1 400 Bad request

今天通过nginx代理下载pdf报这个错,网上查了很多资料,说的大部分都是Androidstudio这个的解决办法,几乎没有针对nginx的处理,部分说是需要配hosts,配了hosts也没用,有一些说是要增加proxy_set_headerHost$http_host;这个配置,也不能解决我的问题,这边记录一下针对我这边出现问题处理方式。代码相对简单URLurl=newURL(urlStr);HttpURLConnectionconn=(HttpURLConnection)url.openConnection();//设置超时间为5秒conn.setConnectTimeout(5*1000

There was an unexpected error (type=Bad Request, status=400).

1.问题描述本来是在学习@RequestParam这个注解,前后端代码完善后就在浏览器里进行了测试,结果报了400的错。前端的请求链接如下:@RequestParam【GET请求带参数】2.分析首先得知道400这个状态码是啥意思:400,badrequest意思是“错误的请求";所以是请求方式有问题吗?我寻思这里的GET请求也是符合URL语法的,所以问题肯定出在后端Controller方法上,即后端要求的属性名与前端实际请求携带的属性名不一致,最终导致问题产生。3.解决改一下后端接口的代码就行了错误的写法注意这里写的是“hobbby”,本来应该是“hobby”,也就是说多了一个“b”@GetM

复现路上的花开花落(2)cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘line‘

复现complexyolo运行检测程序报错Traceback(mostrecentcalllast):File"test_detection.py",line152,inbev_utils.drawRotatedBox(RGB_Map,int(x),int(y),int(w),l,int(yaw),cnf.colors[int(cls_pred)])File"E:\IDM下载\conplexyolo\Complex-YOLOv3\utils\kitti_bev_utils.py",line174,indrawRotatedBoxcv2.line(img,(corners_int[0,0],co