Making API Calls
Due to sockets being unavailable in Pyodide, http libraries are currently unsupported out of the box.
A patch for requests
and urllib
has been provided by the package Pyodide-HTTP and is preinstalled in react-py
.
See Using Packages for package installation instructions, for these examples the following Packages
object has be used:
{
micropip: ["requests"];
}
Try it out:
Setting up environment...
Loading...
GET
Setting up environment...
Loading...
POST
Setting up environment...
Loading...
PUT
Setting up environment...
Loading...
DELETE
Setting up environment...
Loading...