Add documentation on how to read request data #6563
+105
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Didn't find any information on this topic in the entire Phoenix documentation, most StackOverflow questions related to this topic are from either 11 years ago and refer to Plug's
read_bodyfunction or are referring to reading raw request data, which isn't my case.This PR documents:
mix phx.newcommand with all--no-*flags for creating a bare bones JSON API.As a new user of the framework, this sort of stuff is absolutely critical to get us through the door, especially for those of us coming from an "Express/Nest" style background and looking for better alternatives to do backend work.
I can't speak for all backend JS developers, but I feel like features such as LiveView and HEEx Templates, while flagship functionalities and core to the "Phoenix experience", are not the biggest priority in the adoption cycle for most of us. We're more interested in getting a simple backend service up and running before exploring other possibilities.
Feedback is more than welcome :)
[2025-12-30] EDIT: Just to be sure I didn't miss anything, I went over Plug's documentation once again and actually found some information on this. It's still a bit confusing as a newcomer, and I'd have to understand how Plug and Phoenix interact just to read some data, which is not ideal. I still think the change is worth considering.