Skip to content

Commit 5261fa5

Browse files
committed
remove the old deprecated request interface
1 parent 088e161 commit 5261fa5

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

lib/twilio-ruby/rest/client.rb

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -161,42 +161,6 @@ def inspect # :nodoc:
161161
end
162162
end
163163

164-
##
165-
# Mimic the old (deprecated) interface. Make an HTTP request to Twilio
166-
# using the given +method+ and +uri+. If the +method+ is <tt>'GET'</tt>
167-
# then +params+ are appended to the +uri+ as urlencoded query parameters.
168-
# If the +method+ is <tt>'POST'</tt> or <tt>'PUT'</tt> then +params+ are
169-
# passed as an application/x-www-form-urlencoded string in the request
170-
# body.
171-
#
172-
# Returns the raw Net::HTTP::Response object.
173-
def request(uri, method='POST', params={}) # :nodoc:
174-
raise ArgumentError, 'Invalid path parameter' if uri.empty?
175-
176-
uri = "/#{uri}" unless uri.start_with? '/'
177-
178-
case method.upcase
179-
when 'GET'
180-
uri << "?#{url_encode(params)}" if params
181-
req = Net::HTTP::Get.new uri
182-
when 'DELETE'
183-
req = Net::HTTP::Delete.new uri
184-
when 'PUT'
185-
req = Net::HTTP::Put.new uri
186-
req.form_data = params
187-
when 'POST'
188-
req = Net::HTTP::Post.new uri
189-
req.form_data = params
190-
else
191-
raise NotImplementedError, "HTTP #{method} not implemented"
192-
end
193-
194-
req['User-Agent'] = 'twilio-ruby/deprecated'
195-
req.basic_auth @account_sid, @auth_token
196-
@last_request = req
197-
@last_response = @connection.request req
198-
end
199-
200164
private
201165

202166
##

0 commit comments

Comments
 (0)