ERR_INCOMPLETE_CHUNKED_ENCODING
Symptoms
Simple view to "submit" an object (update "submitted" attribute to a datetime object
The View
class ContractCloseOutSubmitView(APIView):
def post(self, request, contract_id):
contract = get_object_or_404(
ContractCloseOut, pk=contract_id)
if contract.submit():
return Response({"detail": "Closed successfuly."}, status=200)
else:
raise ParseError("Could not submit.")
The Stack
The Clues
Ends up that nginx's buffer loses it's shit when you don't read the response body of a POST.
You can either force the buffer to read the entire request (which can be inefficient). Or.....
The Solution
class ContractCloseOutSubmitView(APIView):
def post(self, request, contract_id):
data = request.data #touchie touchie
contract = get_object_or_404(
ContractCloseOut, pk=contract_id)
if contract.submit():
return Response({"detail": "Closed successfuly."}, status=200)
else:
raise ParseError("Could not submit.")
wat