postman post请求 发送form表单数据/发送json数据

admin|
728

使用postman 发送post请求   form表单数据填写位置:


后端代码:


          def post(self, request):
        jip_port = request.POST.get('ip_port')
        juname = request.POST.get('uname')
        jpswd = request.POST.get('pswd')
        result = {"status": 200, "msg": "登录成功"}
        return HttpResponse(json.dumps(result), content_type="application/json,charset=utf-8")

使用postman 发送post请求   json数据填写位置:


后端代码:


    def post(self, request):
    res = request.body.decode('utf-8')