From 3fdb1857312369c95f59024fcfcfa9deb31f7419 Mon Sep 17 00:00:00 2001 From: Trevor Blanarik Date: Mon, 9 Sep 2024 07:41:20 +0000 Subject: [PATCH] i forget how to python --- function_app.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/function_app.py b/function_app.py index 7ec2949..bac13ed 100644 --- a/function_app.py +++ b/function_app.py @@ -9,19 +9,14 @@ def spotbot(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') - try: - req_body = req.get_json() - except ValueError: - pass - else: - fullCallsign = req_body.get('fullCallsign', 'Unknown') - source = req_body.get('source', 'Unknown') - frequency = req_body.get('frequency', 'Unknown') - mode = req_body.get('mode', 'Unknown') - summitRef = req_body.get('summitRef', '') - wwffRef = req_body.get('wwffRef', '') + req_body = req.get_json() + fullCallsign = req_body.get('fullCallsign', 'Unknown') + source = req_body.get('source', 'Unknown') + frequency = req_body.get('frequency', 'Unknown') + mode = req_body.get('mode', 'Unknown') + summitRef = req_body.get('summitRef', '') + wwffRef = req_body.get('wwffRef', '') - content = {"content": f"{fullCallsign} | {source} | freq: {frequency} | mode: {mode} | loc: {summitRef}{wwffRef}"} target_url = os.getenv('TARGET_URL')