The servlet API does not have this function because it was created at a time when many believed that the query string and message body were just two different ways of sending parameters, not realizing that the goals of the parameters are fundamentally different.
Query string options? foo = bar are part of the URL because they are involved in identifying the resource (which can be a collection of many resources), for example, "all persons aged 42":
GET / people? age = 42
The message body parameters in POST or PUT are intended to express the modification of the target resource (s). Fx sets the value to the "hair" attribute:
Put / people? age = 42
hair = gray
Thus, definitely RESTful uses both query parameters and body parameters at the same time, separated so that you can use them for different purposes. This feature is certainly not available in the Java Servlet API.
Ola Berg Sep 08 2018-12-12T00: 00Z
source share