For DELETE requests TestClient encodes data as QUERY_STRING and forces an empty payload
|Reported by:||Owned by:||Aymeric Augustin|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The Test Client's delete method is too limited.
The http 1.1 rfc (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html) doesn't specify that a request body is not allowed for DELETE requests. In fact the method is more similar to POST's and PUT's then it is to GET's. However when making a DELETE request with the test client the data is encoded as the query_string and no request-body-payload is provided
I would personally make it behave the same way as POST's do, but I can imagine a lot of code may depend on the existing implementation.
Change History (10)
comment:1 Changed 5 years ago by
|Component:||Uncategorized → Testing framework|
|Patch needs improvement:||set|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Uncategorized → Cleanup/optimization|