Cisco Certified Support Technician (CCST) NetworkingAutomation and ProgrammabilityMedium
A technician is writing a script to monitor network device health. The script needs to periodically send requests to a device's API and receive responses containing metrics like CPU utilization and memory usage. To ensure efficient communication and avoid unnecessary overhead, which HTTP status code indicates that a request was successful and the requested data is included in the response body?
- A200 OK
- B301 Moved Permanently
- C500 Internal Server Error
- D404 Not Found
Show answer & explanationAnswer & explanation
Correct answer: A. 200 OK
The HTTP status code '200 OK' signifies that the request has succeeded, and for a GET request (like retrieving metrics), the response body contains the requested data. It is the standard success code for such operations.
Why the other options are wrong
- B. 301 Moved Permanently indicates that the requested resource has been permanently moved to a new URL.
- C. 500 Internal Server Error indicates a generic error on the server side.
- D. 404 Not Found indicates that the server could not find the requested resource.
HTTP Status Code 200 OK
An HTTP response status code indicating that the request has succeeded. The information returned with the response depends on the method used in the request.
- Indicates successful request
- For GET, response body contains requested data
- Most common success code
Memory trick: Status codes tell you if it's Good, Redirect, Client bad, or Server bad.