Open ariadne240 opened 4 years ago
해당 부분에 대해서 따로 테스트를 하지는 않겠지만 실습 시간에 배운 것과 같이 400(Bad request)처리를 해주시면 좋습니다. (이 부분에 대해서 따로 테스트를 하지 않는 이유는 json content에 대해서 frontend level에서 validation이 가능하기 때문입니다.)
try:
# decode body and read value from key
except (JSONDecodeError, KeyError):
return HttpResponseBadRequest()
처리시 우선 순위를 따진다면 다음과 같이 처리해 주시기 바랍니다.
감사합니다.
README에서는 400을 처리해야 한다는 말이 없는 것 같은데, 혹시 body에 적절한 key가 들어오지 않았을 경우를 대비해서 400 Bad Request를 처리해 주어야 하나요?