Skip to content

Commit 8770a84

Browse files
committed
Add QUERY HTTP method
1 parent a2f2d1c commit 8770a84

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎lib/protocol/http/methods.rb‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module HTTP
1818
# | OPTIONS | Optional | Yes | Yes | Yes | No |
1919
# | TRACE | No | Yes | Yes | Yes | No |
2020
# | PATCH | Yes | Yes | No | No | No |
21+
# | QUERY | Yes | Yes | Yes | Yes | Yes |
2122
#
2223
# These methods are defined in this module using lower case names. They are for convenience only and you should not overload those methods.
2324
#
@@ -50,6 +51,9 @@ class Methods
5051
# The PATCH method applies partial modifications to a resource.
5152
PATCH = "PATCH"
5253

54+
# The QUERY method requests a server-side query of the target resource.
55+
QUERY = "QUERY"
56+
5357
# Check if the given name is a valid HTTP method, according to this module.
5458
#
5559
# Note that this method only knows about the methods defined in this module, however there are many other methods defined in different specifications.

‎test/protocol/http/methods.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
it_behaves_like ValidMethod, "OPTIONS"
3434
it_behaves_like ValidMethod, "TRACE"
3535
it_behaves_like ValidMethod, "CONNECT"
36+
it_behaves_like ValidMethod, "QUERY"
3637

37-
it "defines exactly 9 methods" do
38-
expect(subject.constants.length).to be == 9
38+
it "defines exactly 10 methods" do
39+
expect(subject.constants.length).to be == 10
3940
end
4041

4142
with ".valid?" do

0 commit comments

Comments
 (0)