Complete the code to send a GET request to example.com using curl.
curl [1] https://example.comThe -X GET option tells curl to use the GET method explicitly.
Complete the code to send a POST request with data 'name=John' using curl.
curl -X POST [1] 'name=John' https://example.com/api
The -d option sends the specified data in a POST request.
Fix the error in the code to include a header 'Content-Type: application/json' in the curl request.
curl -X POST [1] 'Content-Type: application/json' https://example.com/api
The -H option adds a header to the curl request.
Fill both blanks to save the output of a GET request to a file named 'response.txt' and show only the HTTP status code.
curl [1] https://example.com -o [2]
The -w '%{http_code}' -s option shows only the HTTP status code silently, and -o response.txt saves the output to the file.
Fill all three blanks to send a POST request with JSON data '{"user":"admin"}', include the correct header, and save the response to 'result.json'.
curl [1] [2] -d '{"user":"admin"}' https://example.com/api -o [3]
Use -X POST to specify the POST method, -H 'Content-Type: application/json' to set the header, and -o result.json to save the response.