This repository has been archived on 2024-01-13. You can view files and clone it, but cannot push or open issues or pull requests.
arka-mvp/api/views.py
2022-09-15 22:25:55 +03:00

13 lines
359 B
Python

import json
from django.http import HttpResponse
def call_method(request, method_name):
tmp = {}
for key in request.GET:
tmp[key] = request.GET[key]
response = HttpResponse(json.dumps({"response": {"method": method_name, "params": tmp}}, ensure_ascii=True))
response.headers["Content-type"] = "application/json"
return response