200-901 · Question #57
Which command tests a REST API?
The correct answer is C. curl. The curl command-line tool is the standard utility for sending HTTP requests to REST APIs, allowing users to specify methods, headers, and body data to test endpoints.
Question
Which command tests a REST API?
Options
- Anc
- Btcpdump
- Ccurl
- Dtelnet
How the community answered
(35 responses)- A3% (1)
- B6% (2)
- C91% (32)
Why each option
The curl command-line tool is the standard utility for sending HTTP requests to REST APIs, allowing users to specify methods, headers, and body data to test endpoints.
nc (netcat) is a raw TCP/UDP networking utility; while it can send raw data, it does not understand HTTP semantics or REST and is not used for REST API testing.
tcpdump is a packet capture tool used for network traffic analysis; it passively captures packets and does not send HTTP requests.
curl supports all HTTP methods (GET, POST, PUT, DELETE, PATCH) and allows specification of headers, authentication tokens, request bodies, and SSL options via command-line flags, making it the de facto tool for manually testing and debugging REST API endpoints. Its output displays the raw HTTP response including headers and body, which is essential for verifying API behavior.
telnet is used to establish raw TCP connections for troubleshooting connectivity; it does not provide HTTP method support or REST API testing capabilities.
Concept tested: Using curl to test REST API endpoints
Source: https://curl.se/docs/manpage.html
Topics
Community Discussion
No community discussion yet for this question.