jsonresponse

JsonResponse 왜 사용하는가? - response를 커스터마이징 하여 전달할때 사용한다 - http status code에 더하여 메세지를 입력해서 전달할 수 있다. 특징 HttpResponse의 subclass로, JSON-encoded response를 생성할수 있게 해준다. 대부분의 기능은 superclass에서 상속받는다. default Content-Type header = application/json >>> from django.http import JsonResponse # import from django.http >>> response = JsonResponse({'foo': 'bar'}) # 첫번째 argument는 dictionary 이어야한다 >>> response.con..
Sungwoo Koo
'jsonresponse' 태그의 글 목록