From 0c4c15b75cf1a848518d8f136f37f3315c285270 Mon Sep 17 00:00:00 2001 From: Chris Cowley Date: Wed, 2 Apr 2025 14:40:53 +0200 Subject: [PATCH] return headers as JSON instead --- app.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app.py b/app.py index 7227fd7..0ab795a 100644 --- a/app.py +++ b/app.py @@ -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)