Can you make an HTTP request inside an Ajax action?


#1

I have a regular controller action which, when called, makes an HTTP
GET request to another server. That works fine. I’d like to throw
that inside an action called with link_to_remote, but that’s having
problems. The error I get follows. Any ideas?

Pat

http://localhost:3000/main/ -> /javascripts/prototype.js
[2006-02-22 06:08:11] ERROR ThreadError: timeout within critical session
/usr/local/lib/ruby/1.8/timeout.rb:49:in timeout' /usr/local/lib/ruby/1.8/timeout.rb:76:intimeout’
/usr/local/lib/ruby/1.8/webrick/httprequest.rb:329:in
_read_data' /usr/local/lib/ruby/1.8/webrick/httprequest.rb:340:inread_line’
/usr/local/lib/ruby/1.8/webrick/httprequest.rb:240:in
read_header' /usr/local/lib/ruby/1.8/webrick/httprequest.rb:88:inparse’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:56:in run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:69:indispatch’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/webrick.rb:59
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:inrequire’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:inrequire’
./script/server:3
[2006-02-22 06:08:11] ERROR HTTPRequest#fixup:
WEBrick::HTTPStatus::LengthRequired occured.