flexxui/flexx

I couldn't find any example of sending ajax request and getting response

component6 opened this issue · 1 comments

Good afternoon.
I couldn't find any example of sending ajax request and getting response

Could you describe an example of how to make a GET or POST request to aiohttp server (https://flexx.readthedocs.io/en/stable/examples/serve_with_aiohttp_src.html#serve-with-aiohttp-py)
We have a button:

  1. click on it
  2. a request is sent
  3. process the request, send the response (for example, content_type='application/json')
  4. get a response, redraw part of the application

Or is it fundamentally wrong? And is it done differently?

You should probably use the Flexx event system, using actions and reactions. These can work accross the client-server boundary: https://flexx.readthedocs.io/en/stable/guide/event_system.html