bbc / nmos-query

AMWA NMOS IS-04 Query API Service
Apache License 2.0
3 stars 2 forks source link

Subscribing to the Query API does not work #5

Closed mgratzke closed 6 years ago

mgratzke commented 6 years ago

I am not a Python expert, but in the file nmosquery / common / routes.py: for the path / subscription /, method "post" (line 65):

shouldn't it be data = json.loads (request.get_data ()) rather than data = json.loads (request.data)

I've fixed that for myself locally, and now the query API subscriptions are basically working.

simonrankine commented 6 years ago

I'm going to have to look into this a bit more, as according to the Flask docs there isn't a get_data() method which probably means it's deprecated. I think what should really happen here is:

data = request.get_json()

I'm suspecting a possible Flask version issue here as all is fine when I run it here, but I think the get_json() method should work in any case.

simonrankine commented 6 years ago

Looks like this is caused by us using an older version of flask internally. Fixed in 94885e827ffca441a1a31429c16be7fc769c3533