Skip to content

Instantly share code, notes, and snippets.

@yuvalif
yuvalif / server.py
Created September 7, 2023 15:53 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@yuvalif
yuvalif / SimpleHTTPPutServer.py
Last active December 3, 2018 09:47 — forked from fabiand/SimpleHTTPPutServer.py
A simple HTTP Server supporting put
# python -m SimpleHTTPPutServer 8080
import SimpleHTTPServer
import BaseHTTPServer
class SputHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_PUT(self):
print self.command + " " + self.path
print self.headers
self.end_headers()