Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to send a simple GET request to example.com using curl.
Linux CLI
curl [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -X POST when you want a GET request.
Adding data (-d) when not needed.
Using -I which only fetches headers.
✗ Incorrect
The simplest way to send a GET request with curl is to provide the URL directly without extra options.
2fill in blank
mediumComplete the code to send a POST request with curl to http://example.com.
Linux CLI
curl [1] http://example.com Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -X GET instead of POST.
Using -I which only fetches headers.
Using -L which follows redirects but does not change method.
✗ Incorrect
Use -X POST to specify the POST method explicitly with curl.
3fill in blank
hardFix the error in the curl command to send JSON data with POST to http://example.com.
Linux CLI
curl -X POST -H 'Content-Type: application/json' -d [1] http://example.com
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting JSON properly causing shell errors.
Using URL-encoded format instead of JSON.
Missing quotes causing syntax errors.
✗ Incorrect
JSON data must be a properly quoted string. Single quotes around the JSON string prevent shell issues.
4fill in blank
hardFill both blanks to save the output of a curl GET request to a file named response.txt.
Linux CLI
curl [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -I which only fetches headers.
Using -O which saves with original filename, not custom.
Putting options in wrong order.
✗ Incorrect
Use -o with the filename before the URL to save output to that file.
5fill in blank
hardFill all three blanks to send a POST request with JSON data and include a custom header.
Linux CLI
curl [1] -H [2] -d [3] http://example.com
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -I which only fetches headers.
Not quoting header or data properly.
Missing -X POST option.
✗ Incorrect
Use -X POST to set method, -H for custom header, and -d for JSON data.