[reportlab-users] Image in a Python page

Tim Roberts timr at probo.com
Tue Jun 5 16:22:17 EDT 2007


David Frank wrote:

>

> It makes a lot of sense to me now. Thank you for the awesome reply.

> Just one last question (since this is getting way out of topic of

> reportlab).....so how would someone be able to put both the

> content-types in the same file (for pages that have both html as well

> as images)?


They are completely separate transactions. You send a response with the
HTML that has Content-Type: text/html. Part of that HTML will be an
<img> tag. That tag is just plain text that will be interpreted by the
browser. When the browser sees it, it will send another HTTP request to
the server asking for the URL in the <img> tag. The server will send
back a response with Content-Type: image/gif. One transaction, one
content-type.

This is something that many people don't realize. When you fetch a web
page with 50 images on it, the browser actually ends up sending 51
completely independent HTTP requests.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list