Initial commit
This commit is contained in:
12
api/views.py
Normal file
12
api/views.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
Reference in New Issue
Block a user