mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2025-09-01 11:26:56 +00:00
@ -142,16 +142,19 @@ 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());
|
||||||
conn.connect();
|
try {
|
||||||
if (StrKit.notBlank(info.getData())) {
|
conn.connect();
|
||||||
OutputStream out = conn.getOutputStream();
|
if (StrKit.notBlank(info.getData())) {
|
||||||
out.write(info.getData().getBytes(CHARSET));
|
OutputStream out = conn.getOutputStream();
|
||||||
out.flush();
|
out.write(info.getData().getBytes(CHARSET));
|
||||||
out.close();
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
return readResponseString(conn);
|
||||||
|
} finally {
|
||||||
|
conn.disconnect();
|
||||||
}
|
}
|
||||||
return readResponseString(conn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
Reference in New Issue
Block a user