Skip to main content

HTTP / Client

Use any http client to communicate with RESTful APIs.

from h2o_wave import main, app, Q, uiimport httpx

@app('/demo')async def serve(q: Q):    if not q.client.initialized:['form'] = ui.form_card(box='1 1 4 6', items=[            ui.buttons([                ui.button(name='clear', label='Clear'),                ui.button(name='download', label='Download', primary=True)            ]),            ui.text_m('No data yet.'),        ])        q.client.initialized = True    if        response = httpx.get('')['form'].items[1].text_m.content = response.text    if q.args.clear:['form'].items[1].text_m.content = 'No data yet.'

Tags: โ€‚http