User agent with POST request
Answered
Sun bear posted this in #help-forum

Sun bearOP
Hi
Is it possible to get user’s userAgent once he submit the form?
I am using formAction
Thank you
Is it possible to get user’s userAgent once he submit the form?
I am using formAction
Thank you
Answered by B33fb0n3
yes, you can access them through the headers
const headersList = await headers()
const userAgent = headersList.get('user-agent')
3 Replies

@Sun bear Hi
Is it possible to get user’s userAgent once he submit the form?
I am using formAction
Thank you

yes, you can access them through the headers
const headersList = await headers()
const userAgent = headersList.get('user-agent')
Answer

Sun bearOP
@B33fb0n3 thanks for helping

happy to help