exception "can't convert URI::HTTPS into String"

J

jakemiles

Hello. I'm trying to to an http post to an https: url (paypal's ipn
postback), and I'm getting this error: "can't convert URI::HTTPS into
String". Does anyone know what this means and how I can fix it? The
relevant code looks like this:

PAYPAL_IPN_POSTBACK_URL = "https://www.sandbox.paypal.com"

PAYPAL_IPN_POSTBACK_REQUEST_URI = "/cgi-bin/webscr"

http = Net::HTTP.new URI.parse(PAYPAL_IPN_POSTBACK_URL)

### from traces I know it gets here okay

### next line blows up with "can't convert URI::HTTPS into
String" ###

http.request_post(PAYPAL_IPN_POSTBACK_REQUEST_URI,
request.raw_post) do |response|
### from traces I know it never gets here
response.read_body do |body|
STDOUT.puts body
end
end

This blows up on the second line, the call to request_post. Does
anyone know what the problem is? Incidentally, I know that there's a
paypal gem I can use for the paypal postback, but I've come this far
and I'd like to get this working. Also, this is running in Ruby on
Rails.

Thanks for any help.

- Jake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top