return headers as JSON instead
All checks were successful
/ build (push) Successful in 18s

This commit is contained in:
Chris Cowley 2025-04-02 14:40:53 +02:00
parent 23905e7177
commit 0c4c15b75c

5
app.py
View file

@ -7,10 +7,7 @@ def show_headers():
# Get headers from request object
headers = dict(request.headers)
# Convert the headers dictionary into a string with key-value pairs separated by commas
headers_str = '\n'.join(f'{key}: {value}' for key, value in headers.items())
return f'Headers:\n{headers_str}'
return headers, 200
if __name__ == '__main__':
app.run(debug=True)