金蝶k3c 对接InvokeHelper类的改写
1.问题:InvokeHelper是调用金蝶k3c工具类,因为之前用的是HttpURLConnection 会有个别中午乱码问题,因而采用hutool包的HttpResponse,HttpRequest。
2.解决:之前HttpURLConnection 调用的关键代码
private static HttpURLConnection initUrlConn(String url, JSONArray paras)
throws Exception {
URL postUrl = new URL(POST_K3CloudURL.concat(url));
HttpURLConnection connection = (HttpURLConnection) postUrl
.openConnection();
if (CookieVal != null) {
connection.setRequestProperty("Cookie", CookieVal);
}
if (!connection.getDoOutput()) {
connection.setDoOutput(true);
}
connection.setRequestMethod(

本文针对金蝶K3C接口调用中出现的中文乱码问题,通过对比HttpURLConnection与Hutool包的HttpResponse进行了代码改写,并分享了具体的实现方案。
最低0.47元/天 解锁文章
724

被折叠的 条评论
为什么被折叠?



