使用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')

 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐