Reputation: 19534
Is it possible to send query parameters via POST or GET to a Google Colab notebook? (And also have the response be either plaintext or structured json)
Upvotes: 4
Views: 5038
Reputation: 38589
You can make direct HTTP requests to the backend from FE Javascript. Here's an example notebook.
Reproducing the key bits:
A webserver can be started on the kernel to serve up arbitrary resources.
The client needs to reference the resource with
https://localhost:{port}
but this will automatically be translated tohttp://localhost:{port}
.By default responses will be cached in the notebook for offline access.
Upvotes: 2