[MacRuby] #1268: force_encoding on NSStrings with Net::HTTP
MacRuby
ruby-noreply at macosforge.org
Fri May 6 07:00:10 PDT 2011
#1268: force_encoding on NSStrings with Net::HTTP
-----------------------------------+----------------------------------------
Reporter: eric@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
-----------------------------------+----------------------------------------
Comment(by eric@…):
Particular instance with the gazette gem was:
{{{
client.add(self.url, :title => self.title)
}}}
However, with the guidance of alloy via IRC, the following code was used
(which does work):
{{{
client.add(String.new(NSString.stringWithString(self.url)), :title =>
String.new(NSString.stringWithString(self.title)))
}}}
In the case of Net::HTTP, the following (example) setup was attempted:
{{{
require 'net/http'
def call_api
url = URI.parse("#{HOST}/api/call.json")
arguments = { 'email' => self.email, 'foo' => self.bar }
resp, data = Net::HTTP.post_form(url, arguments)
end
}}}
While another method has already been utilized, I am fairly positive that
the previous fix would be applicable here as well.
--
Ticket URL: <http://www.macruby.org/trac/ticket/1268#comment:1>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list