[MacRuby] #689: Net::HTTP.post_form() is broken.
#689: Net::HTTP.post_form() is broken. -----------------------------+---------------------------------------------- Reporter: rob@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------+---------------------------------------------- I'm running the latest nightly(05/05/2010), to reproduce: {{{ require 'net/http' Net::HTTP.post_form(URI.parse('http://www.google.com/foobar', { :foo => 'bar' }) # ... Produces: ArgumentError: method `force_encoding:' does not work on NSStrings }}} Thanks. -- Ticket URL: <http://www.macruby.org/trac/ticket/689> MacRuby <http://macruby.org/>
#689: Net::HTTP.post_form() is broken. -----------------------------+---------------------------------------------- Reporter: rob@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------+---------------------------------------------- Comment(by rob@…): Replying to [ticket:689 rob@…]:
I'm running the latest nightly(05/05/2010), to reproduce:
{{{ require 'net/http' Net::HTTP.post_form(URI.parse('http://www.google.com/foobar', { :foo => 'bar' })
# ... Produces: ArgumentError: method `force_encoding:' does not work on NSStrings }}}
Thanks. Syntax error in the last demo, should be: {{{ require 'net/http' Net::HTTP.post_form(URI.parse('http://www.google.com/foobar'), { :foo => 'bar' })
# ... Produces: ArgumentError: method `force_encoding:' does not work on NSStrings }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/689#comment:1> MacRuby <http://macruby.org/>
#689: Net::HTTP.post_form() is broken. -----------------------------+---------------------------------------------- Reporter: rob@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------+---------------------------------------------- Comment(by bricollins@…): I've attached a patch, it uses the native NSString percent escaping instead of that ugly regex. However we don't know if NSUTF8StringEncoding is defined when net/http is required so there is an ugly one liner to define it as 4 otherwise. I've no doubt lsansonetti will figure out a better way. -- Ticket URL: <http://www.macruby.org/trac/ticket/689#comment:2> MacRuby <http://macruby.org/>
#689: Net::HTTP.post_form() is broken. -----------------------------+---------------------------------------------- Reporter: rob@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------+---------------------------------------------- Comment(by bricollins@…): Better version uploaded -- Ticket URL: <http://www.macruby.org/trac/ticket/689#comment:4> MacRuby <http://macruby.org/>
#689: Net::HTTP.post_form() is broken. -----------------------------+---------------------------------------------- Reporter: rob@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | -----------------------------+---------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.7 Comment: This was simply a bug in net/http.rb that was fixed upstream in 1.9, #to_s wasn't called on keys on the given hash. I backported the latest version in r4083 and the snippet now works. -- Ticket URL: <http://www.macruby.org/trac/ticket/689#comment:5> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby