Soru

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

A network automation engineer is developing a Python script to interact with a Cisco REST-based API controller. Which two statements accurately describe the characteristics of HTTP headers, verbs, or data formats in REST APIs? (Select two.)

  1. The Content-Type request header informs the API server about the data format contained within the HTTP request body.Cevap
  2. JSON data payloads support native data types including strings, numbers, booleans, key-value objects, and arrays.Cevap
  3. C
    The Accept header specifies the data format of the payload currently being transmitted in the client's request body.
  4. D
    HTTP POST operations are inherently idempotent, ensuring multiple identical requests produce no additional server state changes.

Cevap

The statement that the Content-Type header informs the server of the request body format and the statement that JSON natively supports strings, numbers, booleans, objects, and arrays are both correct.
The Content-Type request header notifies the server of the data format (e.g., application/json) contained within the HTTP request body. Additionally, JSON natively supports data types such as strings, numbers, booleans, objects (dictionaries), and arrays (lists).

Adım Adım Çözüm

1
Analyze HTTP request headers in RESTful communications.
Content-Type specifies the format of the data being sent to the server in the request body. Accept specifies the format expected in the response payload.
Header roles must be distinguished: Content-Type describes outgoing body data, while Accept describes incoming body preferences.
2
Evaluate data format characteristics for JSON payloads.
JSON structure contains primitive types (strings, numbers, booleans, null) and complex types (objects enclosed in {}, arrays enclosed in []).
JSON is a standard data format used heavily in REST APIs.
3
Assess HTTP verb idempotence.
GET, PUT, and DELETE are idempotent methods. POST is non-idempotent because repeating it creates new resources.
Idempotency means repeating an HTTP request produces the same result on the server state.

Anahtar Kavram

Characteristics of REST HTTP headers (Content-Type vs Accept), HTTP verb idempotency, and JSON data structures.
Tahmini Süre:1m 30s
Bu soruyu puanla