curl -N -X POST http://localhost:3000/execute/stream \
-H "Authorization: Bearer $ISOL8_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request": {
"runtime": "python",
"code": "import time\nfor i in range(3):\n print(i)\n time.sleep(1)"
}
}'
data: {"type":"stdout","data":"0\n"}
data: {"type":"stdout","data":"1\n"}
data: {"type":"stdout","data":"2\n"}
data: {"type":"exit","data":"0"}
Run code and stream output as Server-Sent Events.
curl -N -X POST http://localhost:3000/execute/stream \
-H "Authorization: Bearer $ISOL8_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request": {
"runtime": "python",
"code": "import time\nfor i in range(3):\n print(i)\n time.sleep(1)"
}
}'
data: {"type":"stdout","data":"0\n"}
data: {"type":"stdout","data":"1\n"}
data: {"type":"stdout","data":"2\n"}
data: {"type":"exit","data":"0"}
code and runtime.stdout, stderr, exit, or error.curl -N -X POST http://localhost:3000/execute/stream \
-H "Authorization: Bearer $ISOL8_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request": {
"runtime": "python",
"code": "import time\nfor i in range(3):\n print(i)\n time.sleep(1)"
}
}'
data: {"type":"stdout","data":"0\n"}
data: {"type":"stdout","data":"1\n"}
data: {"type":"stdout","data":"2\n"}
data: {"type":"exit","data":"0"}
Was this page helpful?