Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding support for default queries which are always appended to the URL.

use case: FB Graph api.
  • Loading branch information...
commit b67b5ca7634a63fd346df296c4245608637b461e 1 parent 1868995
@clayallsopp authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/requests.rb
View
6 lib/requests.rb
@@ -64,6 +64,12 @@ def complete_url(fragment)
def http_call(method, url, call_options = {}, &block)
options = call_options
options.merge!(RemoteModule::RemoteModel.default_url_options || {})
+ if query = options.delete(:query)
+ if url.index("?").nil?
+ url += "?"
+ end
+ url += query.map{|k,v| "#{k}=#{v}"}.join('&')
+ end
if self.default_url_options
options.merge!(self.default_url_options)
end
Please sign in to comment.
Something went wrong with that request. Please try again.