Soru

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

A network administrator is designing an automation script that interacts with a REST-based API on a Cisco network controller. Which two statements accurately describe the behavior and characteristics of HTTP verbs in this REST API implementation? (Select two.)

  1. HTTP POST operations create new resources under a target collection and are non-idempotent.Cevap
  2. B
    HTTP GET operations modify device parameters by transmitting configuration payloads in the request body.
  3. HTTP PUT operations completely replace an existing resource state or create a resource at a specific URI, making them idempotent.Cevap
  4. D
    HTTP PATCH operations are designated as safe, read-only requests that return existing resource configurations.

Cevap

The correct statements are that HTTP POST operations create new resources under a target collection and are non-idempotent, and HTTP PUT operations completely replace an existing resource state or create a resource at a specific URI, making them idempotent.
HTTP POST corresponds to creating resources in CRUD operations and is non-idempotent because duplicate calls produce multiple entities. HTTP PUT completely replaces a resource state or creates it at a designated URI, making it idempotent because repeating the request leaves the server in the identical state.

Adım Adım Çözüm

1
Analyze HTTP POST characteristics.
POST creates new resources and is non-idempotent.
In RESTful architecture, POST creates child resources under a URI. Repeated POST requests produce multiple resources with unique identifiers.
2
Analyze HTTP PUT characteristics.
PUT completely replaces a resource and is idempotent.
PUT replaces the full target payload at a designated URI. Repeated execution produces the exact same resource state on the server.
3
Evaluate the incorrect options regarding GET and PATCH.
GET is read-only and safe, whereas PATCH performs partial updates.
GET never modifies server state, while PATCH applies partial updates rather than retrieving resource data.

Anahtar Kavram

RESTful API HTTP Verbs, CRUD Operations, and Idempotency
Bu soruyu puanla