1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-22 01:48:50 +00:00

fix: 修复编译错误

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2017-07-25 16:45:19 +08:00
parent 5908fb17f9
commit 2b0a0d3a20

View File

@ -142,8 +142,8 @@ public class HttpKit {
*/ */
@SneakyThrows @SneakyThrows
public static String send(HttpInfo info) { public static String send(HttpInfo info) {
@Cleanup
HttpURLConnection conn = getHttpConnection(buildUrlWithQueryString(info), info.getMethod().name(), info.getHeader()); HttpURLConnection conn = getHttpConnection(buildUrlWithQueryString(info), info.getMethod().name(), info.getHeader());
try {
conn.connect(); conn.connect();
if (StrKit.notBlank(info.getData())) { if (StrKit.notBlank(info.getData())) {
OutputStream out = conn.getOutputStream(); OutputStream out = conn.getOutputStream();
@ -152,6 +152,9 @@ public class HttpKit {
out.close(); out.close();
} }
return readResponseString(conn); return readResponseString(conn);
} finally {
conn.disconnect();
}
} }
@Data @Data