Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need asynchronous network request demo #146

Open
BrentHuang opened this issue Jul 10, 2024 · 1 comment
Open

need asynchronous network request demo #146

BrentHuang opened this issue Jul 10, 2024 · 1 comment

Comments

@BrentHuang
Copy link

I have a web application. When I click the login button on the page, it sends an HTTP post request to the server and then receive the response from the server. The whole process is required to be asynchronous.
While waiting for the server to respond, a loading animation is placed on the page.

Can you give me a demo of this scenario?

Finally, I will use flet build web to package and deploy this web application.

@BrentHuang
Copy link
Author

When the web application starts, I create a session by session = aiohttp.ClientSession().

Then, in each page of the web application, I use this session object to communicate with the server.

When the web application exits, I want to call await session.close(). How can I do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant