“Django JsonResponse” Code-Antworten

Setzen Sie den HTTP -Antwortinhaltstyp Django

reponse = HttpResponse(content)
response['Content-Type'] = 'application/json' # or application/text, etc.

# one-line usage
reponse = HttpResponse(content, content_type:'application/json')
Lovely Coder

Django JsonResponse

from django.http import JsonResponse
return JsonResponse({'foo':'bar'})
Nihshreyas

Ähnliche Antworten wie “Django JsonResponse”

Fragen ähnlich wie “Django JsonResponse”

Weitere verwandte Antworten zu “Django JsonResponse” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen