You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

14 lines
398 B

import json
from django.http import JsonResponse
def api_home(request,*args,**kwargs):
body = request.body # byte string of Json data
data = {}
try:
data = json.loads(body) #string of json data ---> python dict
except:
pass
data['headers'] = dict(request.headers)
data['content_type'] = request.content_type
print(data)
return JsonResponse(data)