A network engineer is configuring an automated Python script to manage network interfaces on a Cisco controller via a RESTful API. The script interacts with the URI endpoint `/api/v1/interfaces/GigabitEthernet0/1`. Which two statements accurately describe the behavior of HTTP verbs and headers when performing CRUD operations on this REST API endpoint?
- An HTTP PUT request requires a complete payload representing the resource, as any omitted fields may be cleared or restored to default values.Answer
- The Content-Type request header identifies the data format of the sent body, while the Accept header specifies the data format expected in the response.Answer
- CAn HTTP PATCH request creates a new endpoint resource if the target URI does not exist, whereas HTTP POST is restricted to modifying existing resources.
- DHTTP POST maps directly to the CRUD Read operation and is classified as idempotent because repeated requests return identical resource states without side effects.
Answer
The two correct statements state that an HTTP PUT request requires a complete payload representing the resource because omitted fields may be cleared or reset, and that the Content-Type request header identifies the data format of the sent body while the Accept header specifies the format expected in the response.
The correct options accurately identify REST API characteristics: HTTP PUT performs a complete resource replacement, meaning any unmentioned fields in the payload will be reset or cleared on the target server. Additionally, the Content-Type request header informs the server of the payload format being transmitted, while the Accept header declares the media format requested in the server response.
Step-by-Step Solution
Key Concept
Characteristics of REST HTTP Verbs, CRUD Operations, and HTTP Header Negotiation
Estimated Time:2m 0s