Request type: POST
Form data:
Keys | Description |
---|---|
lang | Language code of the source code to compile |
maxruntime (optional) | Maximum runtime in seconds for the solution to be run. Default is 5s. |
source | Source code in the base64 encoded format |
input | Input testcases in the form of a JSON Array of String, each being encoded in base64 format |
expected_output | Expected output in the form of a JSON Array of String, each being encoded in base64 format |
get_output | true, if output of the program should be present in the response, else false |
Example form data:
{
lang: "py2",
source: "cHJpbnRmKCJIZWxsbyBXb3JsZCEiKQ==",
test_count: 2,
input: ["MSAyIDM=", "MyAyIDE="],
expected_output: ["Ng==", "Ng=="],
get_output: true,
maxruntime: 5
}
Langauage | Code |
---|---|
C | c |
C++ | cpp |
Java | java |
Python | py2 |
##Response Types
{
"result":"success",
"data":
{
"testcases":
[
{
"result":"correct",
"output":"Mw=="
}
]
}
}
{
"result":"success",
"data":
{
"testcases":
[
{
"result":"correct"
}
]
}
}
Note: When get_output
is false, expected_output should never be null.
{
"result":"compile_error",
"error":"Q29tcGlsaW5nIGZhaWxlZCB3aXRoIGV4aXRjb2RlIDEsIGNvbXBpbGVyIG91dHB1dDoKcHJvZy5jOiBJbiBmdW5jdGlvbiAnbWFpbic6CnByb2cuYzo0OjE6IGVycm9yOiBleHBlY3RlZCAnOycgYmVmb3JlICd9JyB0b2tlbgogfQogXgo="
}
result
will be success as the program compiled successfully. The result
of each testcase will contain value run-error
.
{
"result":"success",
"data":
{
"testcases":
[
{
"result":"run-error"
,"output":"SGVsbG8gV29ybGQh"
}
]
}
}