Created
December 3, 2019 19:12
-
-
Save perryism/7fa01316fced4db98e628413b255c9d0 to your computer and use it in GitHub Desktop.
the script dumps the headers and the body of a request
This file contains hidden or 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
from flask import Flask, request | |
app = Flask(__name__) | |
import logging, sys | |
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) | |
logger = logging.getLogger(__name__) | |
@app.route("/", methods=["POST", "GET"]) | |
def call(): | |
req = "%s%s"%(request.headers, request.stream.read()) | |
logger.debug(req) | |
return req | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment