﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30113	Ignoring body with application/json payload causes HTTP 400	Yoan Mollard	nobody	"1. Create an example view with Django 2.1.4 that does not consume the request's body:
{{{
@csrf_exempt
def myview(request):
    #print(request.body.decode(""utf8""))
    return HttpResponse()
}}}

2. Now send a a first POST with **application/json** content type, e.g. with axios:
{{{
axios.post(""/myview"", {""some"": ""data""})
}}}

3. Send new identical POST requests, and observe that they cause  HTTP 400 errors:
{{{
[17/Jan/2019 22:27:47] ""POST /myview HTTP/1.1"" 200 0
[17/Jan/2019 22:27:48] ""{""some"":""data""}POST /myview HTTP/1.1"" 200 0
[17/Jan/2019 22:29:44] code 400, message Bad request syntax ('{""some"":""data""}')
[17/Jan/2019 22:29:44] ""{""some"":""data""}"" 400 -
}}}
The JSON payload of the first request is still buffered somewhere and mess up later requests.

4. Now comment out the print function is the view, and see that consuming the payload has fixed the issue"	Bug	new	HTTP handling	2.1	Normal		post, body, json		Unreviewed	0	0	0	0	0	0
