@@ -71,6 +71,12 @@ public final class HttpMethod implements Comparable<HttpMethod>, Serializable {
71
71
*/
72
72
public static final HttpMethod DELETE = new HttpMethod ("DELETE" );
73
73
74
+ /**
75
+ * The HTTP method {@code CONNECT}.
76
+ * @see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.6">RFC 9110, section 9.3.6</a>
77
+ */
78
+ public static final HttpMethod CONNECT = new HttpMethod ("CONNECT" );
79
+
74
80
/**
75
81
* The HTTP method {@code OPTIONS}.
76
82
* @see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.7">RFC 9110, section 9.3.7</a>
@@ -83,7 +89,7 @@ public final class HttpMethod implements Comparable<HttpMethod>, Serializable {
83
89
*/
84
90
public static final HttpMethod TRACE = new HttpMethod ("TRACE" );
85
91
86
- private static final HttpMethod [] values = new HttpMethod [] { GET , HEAD , POST , PUT , PATCH , DELETE , OPTIONS , TRACE };
92
+ private static final HttpMethod [] values = new HttpMethod [] { GET , HEAD , POST , PUT , PATCH , DELETE , CONNECT , OPTIONS , TRACE };
87
93
88
94
89
95
private final String name ;
@@ -97,7 +103,7 @@ private HttpMethod(String name) {
97
103
* Returns an array containing the standard HTTP methods. Specifically,
98
104
* this method returns an array containing {@link #GET}, {@link #HEAD},
99
105
* {@link #POST}, {@link #PUT}, {@link #PATCH}, {@link #DELETE},
100
- * {@link #OPTIONS}, and {@link #TRACE}.
106
+ * {@link #CONNECT}, {@link # OPTIONS}, and {@link #TRACE}.
101
107
*
102
108
* <p>Note that the returned value does not include any HTTP methods defined
103
109
* in WebDav.
@@ -122,6 +128,7 @@ public static HttpMethod valueOf(String method) {
122
128
case "PUT" -> PUT ;
123
129
case "PATCH" -> PATCH ;
124
130
case "DELETE" -> DELETE ;
131
+ case "CONNECT" -> CONNECT ;
125
132
case "OPTIONS" -> OPTIONS ;
126
133
case "TRACE" -> TRACE ;
127
134
default -> new HttpMethod (method );
0 commit comments