Project

General

Profile

Actions

Bug #1404

closed

Net::HTTP::Post failing when a post field contains ":"

Added by imar (Ignacio Martín) almost 14 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.0 (2007-12-25 revision 14709) [i486-linux]
Backport:
[ruby-core:23311]

Description

=begin
require 'net/http'

post_me = {
'var' => 'a:b'
}
uri = URI.parse("www.someserver.com")
request = Net::HTTP::Post.new(uri.path)
request.set_form_data(post_me)


Gives the following error:

/usr/lib/ruby/1.9.0/net/http.rb:1524:in sprintf': invalid value for Integer: ":" (ArgumentError) from /usr/lib/ruby/1.9.0/net/http.rb:1524:in block in urlencode'
from /usr/lib/ruby/1.9.0/net/http.rb:1524:in gsub' from /usr/lib/ruby/1.9.0/net/http.rb:1524:in urlencode'
from /usr/lib/ruby/1.9.0/net/http.rb:1519:in block in encode_kvpair' from /usr/lib/ruby/1.9.0/net/http.rb:1519:in map'
from /usr/lib/ruby/1.9.0/net/http.rb:1519:in encode_kvpair' from /usr/lib/ruby/1.9.0/net/http.rb:1512:in block in set_form_data'
from /usr/lib/ruby/1.9.0/net/http.rb:1512:in each' from /usr/lib/ruby/1.9.0/net/http.rb:1512:in map'
from /usr/lib/ruby/1.9.0/net/http.rb:1512:in set_form_data' from rubybug.rb:7:in '
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0