Skip to content

Commit 333b2fd

Browse files
author
Samuel Alarco
committed
chore: Update Sulu API authentication headers in bash-hello-world-01
1 parent 08f504f commit 333b2fd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

bash-hello-world-01/run_example.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,32 @@ function generate_request_body() {
1010
EOF
1111
}
1212

13+
1314
function create_submission() {
1415
echo "[$(date)] Generating request body..." 1>&2
1516
generate_request_body > request_body.json
1617
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" \
1722
curl --progress-bar \
1823
--no-silent \
1924
-X POST \
2025
-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" \
2327
--data @request_body.json \
2428
--output request_response.json \
2529
"$JUDGE0_CE_BASE_URL/submissions?base64_encoded=true&wait=false"
2630
cat request_response.json
2731
}
2832

2933
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" \
3037
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" \
3339
"$JUDGE0_CE_BASE_URL/submissions/$1?base64_encoded=true&fields=$2"
3440
}
3541

0 commit comments

Comments
 (0)