Skip to content

Commit 97c9675

Browse files
authored
Add QUERY method (internal only) (#103)
1 parent b00139f commit 97c9675

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/HTTPTypes/HTTPRequest.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,15 @@ extension HTTPRequest.Method {
495495
/// https://www.rfc-editor.org/rfc/rfc5789.html
496496
public static var patch: Self { .init(unchecked: "PATCH") }
497497

498+
/// QUERY
499+
///
500+
/// https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/
501+
static var query: Self { .init(unchecked: "QUERY") }
502+
498503
/// CONNECT-UDP
499504
static var connectUDP: Self { .init(unchecked: "CONNECT-UDP") }
505+
506+
var isSafe: Bool {
507+
self == .get || self == .head || self == .options || self == .query
508+
}
500509
}

0 commit comments

Comments
 (0)