python HTTPServer
来源:互联网 发布:手机淘宝不能发布宝贝 编辑:程序博客网 时间:2024/05/10 03:31
'''
Created on 2013-12-3
@author: Administrator
'''
from BaseHTTPServer import HTTPServer, \
BaseHTTPRequestHandler
class RequestHandler(BaseHTTPRequestHandler):
def _writeheaders(self):
self.send_response(200);
self.send_header('Content-type','text/html');
self.end_headers()
def do_HEAD(self):
self._writeheaders()
def do_GET(self):
self._writeheaders()
self.wfile.write("""
<html>
<head>
<title>basehttp</title>
</head>
<body>this is body</body>
</html>
""")
serveraddr = ('', 18765)
sevr = HTTPServer(serveraddr, RequestHandler)
sevr.serve_forever()
启动后用浏览器访问可以看到响应
http://localhost:18765/
- python HTTPServer
- Python搭建HttpServer
- python编写简易HttpServer
- 基于Python的HttpServer
- python 创建httpserver
- python快速搭建HttpServer
- python httpServer 传输图片
- python之HTTPServer学习
- python 搭建httpserver
- python搭建简易HTTPServer服务
- HttpServer
- httpserver
- python实例32[简单的HttpServer]
- 使用python中的HTTPServer创建本地站点
- python实例32[简单的HttpServer]
- 使用python构建httpserver,python+tornado+pika+rabbitmq
- 300 行 python 代码的轻量级 HTTPServer 实现文件上传下载
- python的HttpServer出现socket.accept()阻塞卡死
- WINDOWS游戏编程大师技巧-常见编绎连接错误FAQ
- uva11181 - Probability|Given 条件概率
- 就这样说点什么
- silicon 官网 C8051F30x bootload 例程
- linux下socket编程
- python HTTPServer
- android多线程下载1
- Android开发教程(十)——android程序建立过程
- ARM汇编:printf
- qte-4.8.5在s3c6410平台上的移植
- HTML5参考手册之属性
- sql 导入导出操作Excel
- 网游--行为监测
- HTML5参考手册之事件