I'm facing problem to get data from Django Headers.
My API using CURL:-
curl -X POST \
https://xyx.com \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'xyzId: 3223' \
-H 'abcData: ABC-123' \
-d '{
"name": "xyz",
"dob": "xyz",
"user_info": "xyz",
}'
In my API I need to get xyzId
and abcData
I tried request.META['abcData']
but got error KeyError
.
How do I get Both data in my view?
Please help me to out this problem.
Thanks in advance.