This is my first time asking a question on this platform.
I currently have a camera set up that we are using for people counting. I am using a push function on the camera to push the data I need to a https url (I am just using local host on my pc). I am getting a response but the response is coming in as what seems to be a CombinedMultiDict
which is nothing like the JSON payload documented/expected. Does anyone know how I can pull the "In" and "Out" variables so that I can further work with these variables.
from flask import Flask, request, jsonify
from paho.mqtt import client as mqtt_client
from werkzeug.datastructures import MultiDict
app = Flask(__**name**__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET','POST'])
def home():
print(request.values)
return "Camera"
app.run(host='localhost', port=777)
and once the camera pushes this is the response I get when I print request.values
:
CombinedMultiDict([ImmutableMultiDict([]), ImmutableMultiDict([('{"Source":{"ReportTime":"2022-03-25T16:02:12Z","GroupID":"Group 01","DeviceID":"","ModelName":"SC9133","MacAddress":"00:02:D1:99:DB:13","IPAddress":"192.168.147.172","TimeZone":" 2","DST":"0"},"Data":[{"RuleType":"Counting","CountingInfo":[{"EndTime":"2022-03-25T15:54:00Z","In":0,"Out":0,"StartTime":"2022-03-25T15:53:00Z","RuleName":"Rule-1"}]}]}', '')])])
So I am seeing the in and out variable but I would like to isolate these variables in there own variable if that makes sense. I know this is going to be hard to test as this is a local camera but any advise would be appreciated.