@@ -10,26 +10,32 @@ function generate_request_body() {
10
10
EOF
11
11
}
12
12
13
+
13
14
function create_submission() {
14
15
echo " [$( date) ] Generating request body..." 1>&2
15
16
generate_request_body > request_body.json
16
17
echo " [$( date) ] Creating submission..." 1>&2
18
+
19
+ # Use this header for RapidAPI
20
+ # -H "X-RapidAPI-Key: $RAPIDAPI_KEY" \
21
+ # -H "X-RapidAPI-Host: judge0-ce.p.rapidapi.com" \
17
22
curl --progress-bar \
18
23
--no-silent \
19
24
-X POST \
20
25
-H " Content-Type: application/json" \
21
- -H " X-RapidAPI-Key: $RAPIDAPI_KEY " \
22
- -H " X-RapidAPI-Host: judge0-ce.p.rapidapi.com" \
26
+ -H " Authorization: Bearer $SULU_KEY " \
23
27
--data @request_body.json \
24
28
--output request_response.json \
25
29
" $JUDGE0_CE_BASE_URL /submissions?base64_encoded=true&wait=false"
26
30
cat request_response.json
27
31
}
28
32
29
33
function get_submission() {
34
+ # Use this header for RapidAPI
35
+ # -H "X-RapidAPI-Key: $RAPIDAPI_KEY" \
36
+ # -H "X-RapidAPI-Host: judge0-ce.p.rapidapi.com" \
30
37
curl -H " Accept: application/json" \
31
- -H " X-RapidAPI-Key: $RAPIDAPI_KEY " \
32
- -H " X-RapidAPI-Host: judge0-ce.p.rapidapi.com" \
38
+ -H " Authorization: Bearer $SULU_KEY " \
33
39
" $JUDGE0_CE_BASE_URL /submissions/$1 ?base64_encoded=true&fields=$2 "
34
40
}
35
41
0 commit comments