I want my server to send a multi-page response (multipart / x-mixed-replace). I would prefer some solution using the Sinatra infrastructure or the general Rack application, but any example in ruby ββwould be nice. Here is the equivalent of what I'm trying to do in PHP:
<?php header('Content-type: multipart/x-mixed-replace;boundary="rn9012"'); print "--rn9012\n"; print "Content-type: application/xml\n\n"; print "<?xml version='1.0'?>\n"; print "<content>First Part</content>\n"; print "--rn9012\n"; flush(); sleep(5); print "Content-type: application/xml\n\n"; print "<?xml version='1.0'?>\n"; print "<content>Second Part</content>\n"; print "--rn9012--\n"; ?>
ruby multipart response rack sinatra
Zach
source share