-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
发送POST请求 中文乱码 #4
Comments
@chenjunjie45 不好意思现在才看到,请问是那种模式,能否发出json格式的内容 |
开发者长时间未反馈 |
|
并未复现 PostMessage message = PostMessage.build().lang(
PostLang.builder()
.lang("zh_cn")
.unit(
PostUnit.build()
.title("订单支付成功")
.addTags(
PostTags.build().addTags(
TextTag.builder().text("商品为: ").build(),
TextTag.builder().text("支付金额为: ").build(),
TextTag.builder().text("取餐码为: ").build(),
ATag.builder().text("请查看").href("http://www.example.com/").build(),
AtTag.builder().atAll(true).build()
)
)
)
.build()
);
String webhok = System.getenv("webhook");
String secret = System.getenv("secret");
FeishuRobotClient send = new FeishuRobotClient();
send.setSecret(secret);
send.setWebhook(webhok);
FeishuRobotResponse feiShuRobotResponse = send.sendMessage(message);
System.out.println(feiShuRobotResponse.getMsg()); 建议追踪调查发送请求头信息以及请求体信息是否有误 |
build()之后 message 为 null 正常吗 @hb0730 |
contentJsonStr只是 /**
* 富文本json字符串,优先级高于lang,格式:
* <PRE>
* "post": {
* "zh_cn": {}
* }
* <PRE>
*/
private String contentJsonStr; 核心在于 #toMessage |
@hb0730 看着也没问题,咱还需要我手动依赖 hutool-core,告知一下
|
json序列化支持 我测试环境为
|
通过手动多引入 hutool-http 解决了
我项目用的是 fastjson2,但是这个问题和 json 工具无关,主要和 hutool-http 有关。
@hb0730 这个依赖导致的问题太隐性了,感觉还有优化的空间,希望大佬抽空优化!感谢! |
发送POST请求 中文乱码,已经设置了lang("zh_CN"),有解决方法吗
The text was updated successfully, but these errors were encountered: