public static String processHttpRequest(String completeURL,
Map<String, Object> params,
Map<String, String> customHeaders,
HttpMethod method) throws IOException {
Map<String, String> headers = getDefaultHeader();
if (customHeaders != null) {
headers.putAll(customHeaders);
}
HttpResponse<JsonNode> result = executeHttpMethod(completeURL, params, headers, method);
if (result == null) {
return null;
}
if (result.getStatus() != 200) {
String exceptionResponse = result.getBody().toString();
throw new ServiceException((result.getStatus() + result.getStatusText()),
exceptionResponse);
}
return result.getBody().toString();
}
HttpUtils.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:scalable-task-scheduler
作者:
评论列表
文章目录