Forum: Ruby on Rails Can you make an HTTP request inside an Ajax action?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-02-22 14:12
(Received via mailing list)
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:in `timeout'
        /usr/local/lib/ruby/1.8/webrick/httprequest.rb:329:in
`_read_data'
        /usr/local/lib/ruby/1.8/webrick/httprequest.rb:340:in
`read_line'
        /usr/local/lib/ruby/1.8/webrick/httprequest.rb:240:in
`read_header'
        /usr/local/lib/ruby/1.8/webrick/httprequest.rb:88:in `parse'
        /usr/local/lib/ruby/1.8/webrick/httpserver.rb:56:in `run'
        /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
        /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
        /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'
        /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'
        /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'
        /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:in
`dispatch'
        /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:in
`require'
        /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:in
`require'
        ./script/server:3
[2006-02-22 06:08:11] ERROR HTTPRequest#fixup:
WEBrick::HTTPStatus::LengthRequired occured.
This topic is locked and can not be replied to.