RJ Budzyński
RJ Budzyński9mo ago

request.get not working

requests.get() does not work for me at all in WASM notebooks. I reckon this has something to do with browser security, but I don't know how to deal with it.
3 Replies
Myles Scolnick
Myles Scolnick9mo ago
github.com has a CORS setting. you can try: https://raw.githubusercontent.com/marimo-team/marimo/main/examples/README.md which does not alternatively, you can use a cors proxy. i'm hosting one on Cloudflare for folks if they need it:
text = requests.get(
"https://corsproxy.marimo.app/https://github.com/marimo-team/marimo/raw/main/examples/README.md"
).text
text = requests.get(
"https://corsproxy.marimo.app/https://github.com/marimo-team/marimo/raw/main/examples/README.md"
).text
RJ Budzyński
RJ BudzyńskiOP9mo ago
Hey that works - I mean, both work. Though I suppose there is no way to get rid of the InsecureRequestWarning in a WASM notebook? Also, for hosts other than github I guess I will need to use the proxy. Well, that's easily enough incorporated into the code.
Myles Scolnick
Myles Scolnick9mo ago
I can look at removing the insecure request warning. I think that’s on our end