Soru

Zorluk: ZorCharacteristics of REST-Based APIs (CRUD, HTTP Verbs, Data Formats)

A network automation engineer is building Python scripts to manage network infrastructure via Cisco DNA Center and RESTCONF API endpoints. Match each HTTP request component or operation to its correct RESTful behavior.

  • HTTP POST request targeting a collection URICreates a new resource or triggers an asynchronous task, typically returning a 201 Created or 202 Accepted status code.
  • HTTP PUT request targeting a specific interface resourceReplaces the entire targeted resource state, causing omitted attributes in the payload to revert to default or null values.
  • HTTP PATCH request targeting a specific interface resourceApplies a partial update to the targeted resource, modifying only the fields specified in the request payload.
  • Accept header set to application/yang-data+jsonInforms the API server that the client expects the response body to be formatted in JSON matching a YANG schema.

Cevap

HTTP POST maps to creating a resource or triggering an async task. HTTP PUT maps to replacing the complete representation of a target resource. HTTP PATCH maps to applying partial modifications to a resource. The Accept header specifies the client's expected response format.
Each item matches its fundamental REST API operational characteristic: HTTP POST creates resources/tasks, HTTP PUT replaces the full representation, HTTP PATCH applies partial updates, and the Accept header defines the expected format of response data.

Adım Adım Çözüm

1
Identify the operation performed by HTTP POST in REST APIs.
POST creates child resources or invokes task processing, returning HTTP status codes such as 201 Created or 202 Accepted.
Demonstrate knowledge of HTTP verb to CRUD mapping.
2
Differentiate between HTTP PUT and HTTP PATCH operations.
PUT replaces the complete resource state (omitted fields revert to defaults), whereas PATCH modifies only specified fields (omitted fields remain unchanged).
Distinguish full resource replacement from partial modification in RESTful APIs.
3
Determine the role of the HTTP Accept header.
The Accept header negotiates response encoding (e.g., application/yang-data+json) sent from the server back to the client.
Understand HTTP headers used in RESTCONF and RESTful communications.

Anahtar Kavram

Characteristics of REST-Based APIs (CRUD, HTTP Verbs, Data Formats)
Bu soruyu puanla