pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
295 stars 34 forks source link

HTTP Requests in Pygbag #155

Open AncientEntity opened 5 months ago

AncientEntity commented 5 months ago

Hey I was wondering if you can send a GET request with a body/headers inside of pygbag or if that's a limitation of the system? Thanks.

pmp-p commented 5 months ago

either use

async with fopen(url,mode) as file:
    data = file.read()    

or see https://github.com/pygame-web/pygbag/discussions/120