Bird
0
0

Why does this command fail?

medium📝 Debug Q7 of 15
Linux CLI - Networking Commands
Why does this command fail?
curl -d name=John age=25 http://example.com
AThe -d option requires -X GET
BThe URL is incorrect
CData must be quoted when containing special characters
Dcurl cannot send POST data
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the data argument

    Without quotes, shell may misinterpret or split the data; quoting ensures correct data sending.
  2. Step 2: Check other options

    URL is valid, -d defaults to POST, and curl can send POST data.
  3. Final Answer:

    Data must be quoted when containing special characters -> Option C
  4. Quick Check:

    Quote POST data to avoid shell issues [OK]
Quick Trick: Always quote POST data with special characters [OK]
Common Mistakes:
  • Not quoting data with spaces or symbols
  • Wrong method with -d
  • Assuming curl can't POST

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes