Skip to content

How to get connected user agent string #4226

Closed Answered by falkoschindler
muratbedir asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @muratbedir,

In ui.context you can find the client object with information about the connection and the request:

@ui.page('/')
def index():
    ui.label(ui.context.client.ip)
    ui.label(ui.context.client.request.headers['user-agent'])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@muratbedir
Comment options

Answer selected by muratbedir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants