This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python3 -m SimpleHTTPPutServer 8080 | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
class PutHTTPRequestHandler(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: |