Get request object in server action
Unanswered
Dwarf Crocodile posted this in #help-forum
Dwarf CrocodileOP
Is there a way to get request headers and the user agent from a server action or will i have to use a route handler?
1 Reply
@Dwarf Crocodile Is there a way to get request headers and the user agent from a server action or will i have to use a route handler?
You can retrieve the headers with the [headers() function](https://nextjs.org/docs/app/api-reference/functions/headers). But no you cannot get the raw request object in server actions