Skip to content
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

com.feilong.net.http.HttpClientUtil.getHttpFullInfo(HttpRequest, ConnectionConfig) 要支持自定义返回值类型转换 #755

Closed
venusdrogon opened this issue Nov 6, 2024 · 1 comment
Labels
enhancement New feature or request feilong-net feilong-net
Milestone

Comments

@venusdrogon
Copy link
Collaborator

com.feilong.net.http.HttpClientUtil.getHttpFullInfo(HttpRequest, ConnectionConfig) 要支持自定义返回值类型转换

@venusdrogon
Copy link
Collaborator Author

    private static GuangdianHttpFullInfo pushData(String logKey,String requestJsonString){
        HttpFullInfo httpFullInfo = postAction(requestJsonString);

        //如果有异常
        if (null != httpFullInfo.getUncheckedHttpException()){
            return toGuangdianHttpFullInfo(httpFullInfo);
        }

        //---------------------------------------------------------------
        HttpResponse httpResponse = httpFullInfo.getHttpResponse();

        log.info(
                 "logKey:[{}] requestJsonString:[{}] httpResponse:[{}]",
                 logKey,
                 JsonUtil.format(requestJsonString),
                 JsonUtil.format(httpResponse));
        //---------------------------------------------------------------
        GuangdianHttpFullInfo guangdianHttpFullInfo = toGuangdianHttpFullInfo(httpFullInfo);
        guangdianHttpFullInfo.setGuangdianResponse(responseToBean(logKey, httpResponse.getResultString()));
        return guangdianHttpFullInfo;
    }

@venusdrogon venusdrogon added this to the 4.2.1 milestone Nov 11, 2024
@venusdrogon venusdrogon added feilong-net feilong-net enhancement New feature or request labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feilong-net feilong-net
Projects
None yet
Development

No branches or pull requests

1 participant