Why do I get "undefined method `set_form_data' for URI:Module"

using Ruby 1.9.3
accoding to the docs:

The following should be fine… however…

  require 'net/http'

  url = URI.parse("www.myservice.com/resource/path")
  url.query = URI.set_form_data(params)

  ... make some request...

I get the error message:
undefined method `set_form_data’ for URI:Module
Also, FWIW, I get the same undefined method for: encode_www_form(params)
as well.

Anybody ever see this? If so was there a workaround?

Thanks in advance,