diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb index 7e46e04..2a683b2 100644 --- a/lib/net/http/header.rb +++ b/lib/net/http/header.rb @@ -365,7 +365,11 @@ module Net::HTTPHeader # http.set_form_data({"q" => "ruby", "lang" => "en"}, ';') # def set_form_data(params, sep = '&') - query = URI.encode_www_form(params) + if String === params + query = params + else + query = URI.encode_www_form(params) + end query.gsub!(/&/, sep) if sep != '&' self.body = query self.content_type = 'application/x-www-form-urlencoded'