add bodyEntity

This commit is contained in:
Timi
2026-03-16 16:34:46 +08:00
parent 436ac6f205
commit ef7b9af9b7
9 changed files with 215 additions and 26 deletions

View File

@@ -3,6 +3,7 @@ package com.imyeyu.network;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import org.apache.hc.client5.http.fluent.Request;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.util.Timeout;
import java.io.IOException;
@@ -49,6 +50,11 @@ public class CommonRequest {
return this;
}
public CommonRequest bodyEntity(HttpEntity entity) {
request.body(entity);
return this;
}
public String asString() throws IOException {
return request.execute().returnContent().asString();
}