from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse,JsonResponse
from django.views import View
import json
class IndexView(View):
def get(self,request):
pass
def post(self,request):
res = json.loads(request.body)
# 用户输入钉钉的信息
content = res.get("text").get("content")
print(content)
content = 'xxx'
return JsonResponse(
{"msgtype": "text",
"text": {
"content": "谢谢使用此机器人,{}".format(content)
}
}
)、