new: [json] Route to request asns_global_ranking

pull/12/head
Raphaël Vinot 2019-07-22 15:45:17 +02:00
parent dd39ad2f29
commit c1351fc980
1 changed files with 9 additions and 0 deletions

View File

@ -273,4 +273,13 @@ def country_history():
q = Querying() q = Querying()
return Response(json.dumps(q.country_history(**session)), mimetype='application/json') return Response(json.dumps(q.country_history(**session)), mimetype='application/json')
@app.route('/json/asns_global_ranking', methods=['POST'])
def json_asns_global_ranking():
query = request.get_json(force=True)
to_return = {'meta': query, 'response': {}}
q = Querying()
to_return['response'] = q.asns_global_ranking(**query)['response']
return Response(json.dumps(to_return), mimetype='application/json')
# ############# Json outputs ############# # ############# Json outputs #############