Click here to Skip to main content
Click here to Skip to main content
 

Power of C++ - Developing a Portable HTTP Server with Python Interpreter using Boost, TinyXML

By , 1 Jun 2008
 
ahttpserver_demo.zip
ahttpserver_demo
ahttpserver.exe
boost_python-vc80-mt-1_34_1.dll
python_handler.dll
web
favicon.ico
images
icon_dir.gif
icon_file.gif
icon_virtual_dir.gif
python
print.pyhtml
ahttpserver_src.zip
ahttplib
aconnect
ahttp
http_header_read_check.inl
tinyxml
ahttpserver
makefile
out
server.config.ubuntu
server.config.win-debug
server.config.win-release
web
favicon.ico
images
icon_dir.gif
icon_file.gif
icon_virtual_dir.gif
python
print.pyhtml
python_handler
module.inl
wrappers.inl
import os
from python_handler import *

requestContent = http_context.request.raw_read(1024)

template = """<html><head>
<title>POST test</title>
<style> 
    BODY { padding: 10px; margin: 10px; } 
    BODY, INPUT, SELECT, TEXTAREA {font: 10pt Tahoma, Arial; color: #000;}
    H1 {font-size: 12pt; font-weight: bold; } 
    HR {height:1px; border: 1px solid #333; color: #333;} 
    TABLE {font-size: 100%%;} 
</style></head>
<body>
    Request content: "%s"
 <hr />
 <form method="post">
    <textarea name="text" rows="20"></textarea><br />
    <input type="submit">
 </form>
 </body></html>""" % ( escape_html (requestContent), )
   
http_context.write ( template )

   
    

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Artem Kustikov
Software Developer (Senior)
Belarus Belarus
No Biography provided

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130619.1 | Last Updated 1 Jun 2008
Article Copyright 2008 by Artem Kustikov
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid