Looking for cookbook/recipe generating multipart web data

  • Thread starter Raaijmakers, Vincent \(GE Infrastructure\)
  • Start date
R

Raaijmakers, Vincent \(GE Infrastructure\)

My web server (apache+mod_python) needs to reply on some session with a multipart connection.
My idea is to use the content-type of multipart/mixed; boundary=--myboundary

The data that I would like to send is a continuous stream of data, divided by that boundary.
Well, there are tons of examples on the web how to encode such a stream on the client side, but I can't find an example how to generate this data using mod_python.

So for now in the very simple example, my code looks like:

req.content_type("multipart/mixed; boundary=--myboundary")
while forever:
data = "--myboudary\r\n%s" % getData()
req.write(data)

However, for every req.write, len(data) + lfcr + boundary/data + lfcr is send out and I just want to send boudary/data like I see in existing applications on the web and described in the w3 norms of multipart.

What is the correct way of doing this? Where can I find the proper cookbook?

Thanks,
Vincent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top