小程序 获取 手机号 47001 data format error hint

0.场景

后端获取小程序用户手机号 ,api文档

https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html

使用hutool工具作为http client

1. 正确的写法

正确示例

java 复制代码
   String tencentUrl = StringUtils.format("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={}",access_token);
        HashMap<String, Object> paramMap = new HashMap<>(1);
        paramMap.put("code",jsonRes.getStr("code"));
        String jsonStr =JsonUtils.toJsonString(paramMap);
        HttpResponse httpResponse = HttpRequest.post(tencentUrl)
            .body(jsonStr).execute();

2. 错误的写法

相关推荐
资质小秘书6 小时前
2026 年 8 月行业科普:小程序商家需要北京 ICP 许可证吗?
其他·小程序
2501_9160088913 小时前
移动安全之 APP 加固,保障移动应用安全的重要手段
安全·macos·ios·小程序·uni-app·iphone·xcode
Ai-_Man14 小时前
豆包智能体内容批量导出:哪些该存、存成什么、怎么存v
人工智能·ai·小程序·word
黄华SJ520it17 小时前
三三复制公排系统:裂变电商新引擎
小程序·系统开发
维双云18 小时前
2026做小程序怎么选服务商?SaaS平台与定制公司优缺点分析
小程序
2501_9151063218 小时前
Python爬虫从零开始:七天掌握HTTP协议、数据解析与反爬策略
android·ios·小程序·https·uni-app·iphone·webview
禾高网络2 天前
开启环保新潮流:回收小程序系统功能介绍
java·大数据·小程序
2501_915921432 天前
详细解析,iOS 应用上架 App Store 的完整流程与指南
android·ios·小程序·https·uni-app·iphone·webview
微三云 - 廖会灵 (私域系统开发)2 天前
小程序商城系统安全运维剖析:漏洞、风控与长效迭代方案
运维·小程序·系统安全
2501_915918412 天前
Xcode调试iOS应用内存管理与优化,识别泄漏与性能监控指南
android·ios·小程序·uni-app·cocoa·iphone·xcode