Skip to content

req.body should not be use it for form post #497

@jknack

Description

@jknack

Form post as urlencoded or multipart must be parsed/read using .params or new .form alias from #496

{
  post("/", req -> {
    MyForm form = req.form(MyForm.class);
  });
}

While req.body must be used it for content types like json, xml, ..., etc.

{
  post("/", req -> {
    MyJsonObject object = req.body(MyJsonObject.class);
  });
}

Please note any existing app that use req.body for form post MUST BE UPDATED and use req.params() or req.form()

This is required to fix #444

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions