File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 11
2- recipe :fetch , description : "Fetch the specified URL and print the response." do |url , method :|
2+ # Fetch the specified URL and print the response.
3+ # @param url [String] the URL to parse and fetch.
4+ # @param method [String] the HTTP method to use.
5+ def fetch ( url , method :)
36 require 'async/http/internet'
47 require 'kernel/sync'
58
6871 end
6972end
7073
71- recipe :get , description : "GET the specified URL and print the response." do |url |
72- call :fetch , url , "method=GET"
74+ # GET the specified URL and print the response.
75+ def get ( url )
76+ self . fetch ( url , method : "GET" )
7377end
7478
75- recipe :head , description : "HEAD the specified URL and print the response." do |url |
76- call :fetch , url , "method=HEAD"
79+ # HEAD the specified URL and print the response.
80+ def head ( url )
81+ self . fetch ( url , method : "HEAD" )
7782end
7883
You can’t perform that action at this time.
0 commit comments