Retrieve POST payload inside /app/page.tsx (RSC) #45438
milanbgd011
started this conversation in
Ideas
Replies: 2 comments 6 replies
-
Aren't API Routes supposed to be used in this case? |
Beta Was this translation helpful? Give feedback.
6 replies
-
The POST method to app router page routes is reserved for server actions. You will need to structure your apps differently because this is fundamentally not possible. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
I would like to be able to read POST request from page.tsx inside /app folder, but there is only params and searchparams:
I tried with headers:
But no payload data there as expected.
In getServerProps we had req/res and I pulled data from
req
, now I am not sure how to catch POST request payload in /app/page.tsx server component.Describe the solution you'd like
To simply retrieve POST payload in /app/page.tsx (server component).
Describe alternatives you've considered
none
Beta Was this translation helpful? Give feedback.
All reactions