public
Fork of jnunemaker/httparty
Description: Makes http fun! Also, makes consuming restful web services dead easy.
Homepage:
Clone URL: git://github.com/mattstocum/httparty.git
Check if uri.query is blank, and if so set it to nil.  This prevents appending a 
? to the end of the request if no query options were passed.
mattstocum (author)
Mon Aug 25 13:35:37 -0700 2008
commit  6cbdc306c658bac8478337d19d391a8b99cb4313
tree    cf0a4a0e266ad99f6f66bf5722bf69cc8c64c762
parent  df9957cfa569c4a15230f5b2cda0a5d8f1b3e727
...
117
118
119
 
 
 
120
121
122
...
117
118
119
120
121
122
123
124
125
0
@@ -117,6 +117,9 @@ module HTTParty
0
         else
0
           existing_query + (options[:query].is_a?(Hash) ? default_params.merge(options[:query]).to_query : options[:query])
0
         end
0
+    if uri.query.blank?
0
+      uri.query = nil
0
+    end
0
         klass          = Net::HTTP.const_get method.to_s.downcase.capitalize
0
         request        = klass.new(uri.request_uri)
0
         request.body   = options[:body].is_a?(Hash) ? options[:body].to_query : options[:body] unless options[:body].blank?

Comments