瀏覽代碼

`http`模块新增`HEAD`、`OPTIONS`、`TRACE`、`PATCH`请求方法

mxd 3 年之前
父節點
當前提交
2c60f67cbe
共有 1 個文件被更改,包括 24 次插入0 次删除
  1. 24 0
      magic-api/src/main/java/org/ssssssss/magicapi/modules/http/HttpModule.java

+ 24 - 0
magic-api/src/main/java/org/ssssssss/magicapi/modules/http/HttpModule.java

@@ -161,6 +161,30 @@ public class HttpModule implements MagicModule {
 		return this.execute();
 	}
 
+	@Comment("发送`HEAD`请求")
+	public ResponseEntity<?> head() {
+		this.method(HttpMethod.HEAD);
+		return this.execute();
+	}
+
+	@Comment("发送`OPTIONS`请求")
+	public ResponseEntity<?> options() {
+		this.method(HttpMethod.OPTIONS);
+		return this.execute();
+	}
+
+	@Comment("发送`TRACE`请求")
+	public ResponseEntity<?> trace() {
+		this.method(HttpMethod.TRACE);
+		return this.execute();
+	}
+
+	@Comment("发送`PATCH`请求")
+	public ResponseEntity<?> patch() {
+		this.method(HttpMethod.PATCH);
+		return this.execute();
+	}
+
 	@Comment("执行请求")
 	public ResponseEntity<?> execute() {
 		if (!this.params.isEmpty()) {