Undocumented change between 5.0.0-alpha.8 and 5.0.0-beta.1 with req.body #4909
-
Hello Everyone! I am testing my REST API with 5.0.0-beta.1 and found that the req.body object after
is undefined when an http request with Content-Type application/json without a body is received. With 5.0.0-alpha.8 req.body is an empty object and this behavior conforms with the express.json() API reference (https://expressjs.com/en/5x/api.html). Is this a bug or something to be considered for the future? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry about that! Yes that is intentional. You can find it listed in the change log https://github.com/expressjs/express/blob/v5.0.0-beta.1/History.md#500-beta1--2022-02-14 as
It looks like the docs on expressjs.com where not updated to reflect that. We can get that updated. |
Beta Was this translation helpful? Give feedback.
Sorry about that! Yes that is intentional. You can find it listed in the change log https://github.com/expressjs/express/blob/v5.0.0-beta.1/History.md#500-beta1--2022-02-14 as
It looks like the docs on expressjs.com where not updated to reflect that. We can get that updated.