Query string based on the selection in HTTP POST

I want to generate the query string based on the options selected. For
example
it could be www.test.com/search?id=1 or
www.test.com/search?id=1&zip=60008. How could I achieve this using
http::POST?

I tried the following, which didn’t work
url = “{‘id’ => 1, ‘zip’ => 60008}”
res =
Net::HTTP.post_form(URI.parse’http://www.test.com/search.php’),url)
res = @responsestream = res.body

I guess url is a string and in the post_form it’s suppose to be hash.
Not sure how to do that.