Add all common used request methods to route method.
@@ -14,7 +14,25 @@ module Net
end
def post(path)
- mount(path, "POST") do
+ mount(path, "POST") do |req, res|
+ yield(req, res)
+ end
+ end
+
+ def put(path)
+ mount(path, "PUT") do |req, res|
+ yield(req, res)
+ end
+ end
+
+ def delete(path)
+ mount(path, "DELETE") do |req, res|
+ yield(req, res)
+ end
+ end
+
+ def head(path)
+ mount(path, "HEAD") do |req, res|
yield(req, res)
end
end
