From 76089746bc0b718fc44e63f09935d62648ceaa94 Mon Sep 17 00:00:00 2001 From: Ionite Date: Wed, 16 Nov 2022 21:49:47 -0500 Subject: Add example for post response --- snekbox/api/resources/eval.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py index 7e57e5b..b0678ac 100644 --- a/snekbox/api/resources/eval.py +++ b/snekbox/api/resources/eval.py @@ -38,8 +38,6 @@ class EvalResource: Evaluate Python code and return stdout, stderr, and the return code. A list of arguments for the Python subprocess can be specified as `args`. - Otherwise, the default argument "-c" is used to execute the input code. - The input code is always passed as the last argument to Python. The return codes mostly resemble those of a Unix shell. Some noteworthy cases: @@ -61,7 +59,14 @@ class EvalResource: >>> { ... "stdout": "10000 loops, best of 5: 23.8 usec per loop\n", - ... "returncode": 0 + ... "returncode": 0, + ... "attachments": [ + ... { + ... "name": "output.png", + ... "mime": "image/png", + ... "content" "...=", # Base64 encoded zlib compressed content + ... } + ... ] ... } Status codes: -- cgit v1.2.3