Here is my code, that let users input their ID and Name to check if they are in a list of something.
def some_api(requests):
try:
**do something**
return HttpResponse('Your name is in the list') #Response 302 CODE FOUND NOT 202
except:
return JsonResponse([{ ID : 123, #Response 203 CODE EMPTY NOT 202
Name : ABC, #with information for users to double check
Content : [] #their params
}])
As always, when I return HttpResponse and JsonResponse, it is always the 200 CODE