Skip to content

Instantly share code, notes, and snippets.

@dsolstad
dsolstad / SimpleHTTPPutServer.py
Created February 15, 2019 19:33 — 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.headers
length = int(self.headers["Content-Length"])
path = self.translate_path(self.path)
with open(path, "wb") as dst: