diff --git a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java index 423445fa..7eda4a49 100644 --- a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java +++ b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java @@ -31,6 +31,15 @@ public interface HttpAgent { */ String getEncode(); + /** + * Http post. + * + * @param path + * @param body + * @return + */ + Result httpPost(String path, Object body); + /** * Send HTTP post request by discovery. * diff --git a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java index 3c99f319..cff906a3 100644 --- a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java +++ b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java @@ -41,6 +41,11 @@ public class ServerHttpAgent implements HttpAgent { return null; } + @Override + public Result httpPost(String path, Object body) { + return httpClientUtil.restApiPost(buildUrl(path), body, Result.class); + } + @Override public Result httpPostByDiscovery(String path, Object body) { return httpClientUtil.restApiPost(buildUrl(path), body, Result.class);