charles代理报错400 Bad Request

在使用Charles进行网络代理时遇到400BadRequest错误,问题可能出在缺少P12证书。解决方法包括向研发获取P12证书并正确导入。完成证书安装后,接口抓取将恢复正常。

用charles代理时候接口报错:400 Bad Request。

这是因为charles没有安装P12证书。安装就好了。

安装步骤:1、这个证书找研发要下。

2、

3、导入进去。就成功了。

 接口就会抓成功

curl -X POST "http://10.54.53.240:9996/imodbus/network" -H "Content-Type: application/json" -d '{ "deviceType": "SUN2000L", "deviceVer": "SUN2000L-5KTL", "modelType": "单相1.0", "softVer": "V100R001C00SPC334", "esn": "lxt_red_125569", "version": "8.0", "component": [ { "type": "Power Sensor", "prop": { "checked": true } }, { "type": "Energy Store", "prop": { "checked": true, "FE": true } }, { "type": "Optimizer", "prop": { "num": 2 } } ], "num": 1, "ip": "10.54.53.80", "port": "16101", "children": [], "connect": false }' -s -o /dev/null -w "Status: %{http_code}\n"这个是400,Completed 400 BAD_REQUEST 2025-11-06 16:49:12:206 [http-nio-9996-exec-4] DEBUG org.springframework.web.servlet.DispatcherServlet - "ERROR" dispatch for GET "/error", parameters={} 2025-11-06 16:49:12:206 [http-nio-9996-exec-4] DEBUG c.h.c.w.c.w.DefaultWushanRequestMappingHandlerMapping - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest) 2025-11-06 16:49:12:207 [http-nio-9996-exec-4] DEBUG o.s.w.s.m.m.annotation.HttpEntityMethodProcessor - Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/yaml] 2025-11-06 16:49:12:207 [http-nio-9996-exec-4] DEBUG o.s.w.s.m.m.annotation.HttpEntityMethodProcessor - Writing [{timestamp=Thu Nov 06 16:49:12 CST 2025, status=400, error=Bad Request, path=/imodbus/network}] 2025-11-06 16:49:12:208 [http-nio-9996-exec-4] DEBUG org.springframework.web.servlet.DispatcherServlet - Exiting from "ERROR" dispatch, status 400
最新发布
11-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值