Added flatcher
This commit is contained in:
parent
cecde4478d
commit
06f92a3228
19
flatcher
Executable file
19
flatcher
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
from flask import Flask, request
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/', defaults={'path': ''}, methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'])
|
||||||
|
@app.route('/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'])
|
||||||
|
def capture_request(path):
|
||||||
|
"""
|
||||||
|
This route captures all requests, regardless of method or path.
|
||||||
|
"""
|
||||||
|
print(f"Request Path: {request.path}")
|
||||||
|
print(f"Request Method: {request.method}")
|
||||||
|
print(f"Request Headers: {dict(request.headers)}")
|
||||||
|
print(f"Request Body: {request.get_data(as_text=True)}")
|
||||||
|
return "Request captured and printed to the console!", 200
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True, host='0.0.0.0', port=5000)
|
Loading…
x
Reference in New Issue
Block a user