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

No requests? #91

Closed
MaLin1997 opened this issue May 1, 2022 · 8 comments
Closed

No requests? #91

MaLin1997 opened this issue May 1, 2022 · 8 comments
Labels
tag: pyodide Related to issues with pyodide type: feature New feature or request

Comments

@MaLin1997
Copy link

image

@philippjfr
Copy link
Contributor

Correct, pyodide does not yet support requests or in fact urllib3 because the entire networking stack does not translate to a browser environment very well. This is something we are looking at but you can also track similar issues on the pyodide repo: pyodide/pyodide#398

@amitsaha
Copy link

amitsaha commented May 9, 2022

@MaLin1997 You may find my blog post helpful: https://echorand.me/posts/py-script-monkey-patch-requests/ - essentially monkey patch requests to use the Pyiodide functionality that's available. It's only useful for GET requests though.

@marimeireles
Copy link
Member

No requests yet. We will be tackling this in the future. But we have awesome documentation thanks to @emirkmo!
So, I'm closing this for now but we have this in mind.
Thank you for the issue.

@marimeireles
Copy link
Member

Forgot to add the links to the docs: https://docs.pyscript.net/latest/howtos/http-requests.html

@andeplane
Copy link

Link now gies 404 @marimeireles. I suppose this is the one now https://docs.pyscript.net/latest/guides/http-requests.html

@FabioRosado
Copy link
Contributor

Link now gies 404 @marimeireles. I suppose this is the one now https://docs.pyscript.net/latest/guides/http-requests.html

Hello @andeplane the docs suffered from a big update since this issue was closed. This is the correct link: https://docs.pyscript.net/latest/guides/http-requests.html

Please let us know if this helps

@JeffersGlass
Copy link
Member

For those finding this in the future - the pyodide-http project aims to provide replacements for networking libraries like requests and urllib in Pyodide.

In PyScript 2022.12.1/Pyodide 0.21.3, you can install this by using:

<py-config>
  packages = ['pyodide-http']
</py-config>

And adding steps #2 and #3 of the usage section of the pyodide-http docs.

@pquentin
Copy link

urllib3 2.2.0 supports Pyodide: https://urllib3.readthedocs.io/en/stable/reference/contrib/emscripten.html. Which means requests supports it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: pyodide Related to issues with pyodide type: feature New feature or request
Projects
Archived in project
Development

No branches or pull requests

9 participants