add bodyEntity
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user