Meditate on this:
require 'uri'
scheme, userinfo, host, port, registry, path, opaque, query, fragment = URI.split('http://example.com?test=true&message=hello')
scheme # => "http"
userinfo # => nil
host # => "example.com"
port # => nil
registry # => nil
path # => ""
opaque # => nil
query # => "test=true&message=hello"
fragment # => nil
uri = URI.parse('http://example.com?test=true&message=hello')
server = '%s://%s' % [uri.scheme, uri.host] # => "http://example.com"
parameters = Hash[URI.decode_www_form(uri.query)] # => {"test"=>"true", "message"=>"hello"}
At this point you can use whatever you want to connect to the server
and send the parameters
using GET, POST or any of the other request types.
URI is built into Ruby and has all the methods necessary to take apart URLs correctly and rebuild them.
When learning a computer language, it's mandatory to read through all the libraries and become familiar with their offerings. I do it many times, not to know exactly where a particular method is and its parameters, but to remember that it exists somewhere and then I can search and find it. Any modern language that can talk to web services will have such functionality available to it; It's your job to read the documentation and become familiar with it.