Pushing data once a URL is requested

Posted by Eli Grey on Stack Overflow See other posts from Stack Overflow or by Eli Grey
Published on 2010-04-05T02:58:48Z Indexed on 2010/04/05 3:03 UTC
Read the original article Hit count: 342

Filed under:
|

Given, when a user requests /foo on my server, I send the following HTTP response (not closing the connection):

Content-Type: multipart/x-mixed-replace; boundary=-----------------------

-----------------------
Content-Type: text/html

<a href="/bar">foo</a>

When the user clicks on foo (which will send 204 No Content so the view doesn't change), I want to send the following data in the initial response.

-----------------------
Content-Type: text/html

bar

How would could I get the second request to trigger this from the initial response? I'm planning on possibly creating a fancy [engines that support multipart/x-mixed-replace (currently only Gecko)]-only email webapp that does server-push and Ajax effects without any JavaScript, just for fun.

© Stack Overflow or respective owner

Related posts about python

Related posts about wsgi