pygame-web / pygbag

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

HTTP Requests in Pygbag #155

Open AncientEntity opened 9 months ago

AncientEntity commented 9 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 9 months ago

either use

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

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