Home > Mobile >  Django JsonResponse customize its header
Django JsonResponse customize its header

Time:01-13

I want to change response header of

> from django.http import JsonResponse

function for example change Date header how?

CodePudding user response:

You can alter it as a key-value dictionary, so:

from django.http import JsonResponse

response = JsonResponse()
response['Date'] = 'some value'
return response
  • Related