118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
# File 'lib/http_requestor.rb', line 118
def self.request(domain, request_type, request_path, data={}, ={}, options={})
request_type.to_s.upcase!
request_type = valid_request_types[0] unless valid_request_types.include?(request_type)
req = self.new(domain, options)
if request_type == "GET"
return req.get(request_path, data, )
elsif request_type == "POST"
return req.post(request_path, data, )
elsif request_type == "PUT"
return req.put(request_path, data, )
elsif request_type == "DELETE"
return req.delete(request_path, data, )
elsif request_type == "OPTIONS"
return req.options(request_path, data, )
elsif request_type == "PATCH"
return req.patch(request_path, data, )
elsif request_type == "MOVE"
return req.move(request_path, data, )
elsif request_type == "HEAD"
return req.head(request_path, data, )
elsif request_type == "TRACE"
return req.trace(request_path, data, )
end
end
|