Error when checking user status
I receive status code when I paste url in browser, but when I
try to do
status = Net::HTTP.get_response(URI.parse("https://mysite.chargevault.com/status?key=key&code=code")).body
I receive this error:
Net::HTTPBadResponse: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"
/usr/ruby1.9.2/lib/ruby/1.9.1/net/http.rb:2221:in `read_status_line'
/usr/ruby1.9.2/lib/ruby/1.9.1/net/http.rb:2208:in `read_new'
/usr/ruby1.9.2/lib/ruby/1.9.1/net/http.rb:1191:in `transport_request'
/usr/ruby1.9.2/lib/ruby/1.9.1/net/http.rb:1177:in `request'
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Marc Guyer on 19 May, 2011 02:48 PM
Hi Ildar -- Can you tell what the raw response is?
Support Staff 2 Posted by Marc Guyer on 19 May, 2011 04:25 PM
I guess that bit of code was untested. It turns out to be much more involved because of the ssl:
3 Posted by ildar.abdulin on 20 May, 2011 01:22 AM
Problem solved,
Thank you!
Marc Guyer closed this discussion on 20 May, 2011 03:27 PM.