Skip to content

Instantly share code, notes, and snippets.

@aagallag
aagallag / reflect.py
Last active July 12, 2016 05:33 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
# Modifications by Aaron Gallagher (2016)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
import datetime
LOG_FILE = 'log_%s.txt' % datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')