0
cursor.execute("SELECT DISTINCT User.name,Person.id,Person.firstName,Person.lastName,User.tokenHash from User JOIN Person ON User.personId = Parkloco.Person.id WHERE User.name = '%s' AND User.enabled = 1 " % username)
fields = map(lambda x: x[0], cursor.description)
result = [dict(zip(fields, row)) for row in cursor.fetchall()]
Response['X-Auth'] = result.tokenHash
return Response(result,status=status.HTTP_201_CREATED)
Wie Antwortkopf in Django zu analysieren.django parse Response-Header X-Auth
aber es sollte so sein. Danke für die Antwort. header = {'X-Auth': result.tokenHash} Rückgabe Antwort (Ergebnis, Status = Status.HTTP_201_CREATED, Header = Header) –