Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3330 Lượt xem

Hi there, I got some format issue on json respone. I would like to give some error message on my controller. below is my code and it is sending 400 response but I tried with Postman and there is no specific message.


if citizen_chk != True:
       return Response(json.dumps({"err":"Login only for citizen"}),content_type='application/json;charset=utf-8',status=400)


I got the response in postman as below,

{"jsonrpc": "2.0", "id": null, "result": " Response 53 bytes [400 BAD REQUEST] "}


May I know how to show my message " Login only for citizen" ?


Thanks


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 22
3614
2
thg 4 20
4528
1
thg 4 20
3471
2
thg 9 19
9043
2
thg 6 19
5578