300-435 · Question #120
Refer to the exhibit. An engineer must split the network ENAUTO by using Cisco Meraki APIs. Which code snippet must be added to the box in the code to complete the Python code? import requests url =…
The correct answer is A. response = requests.request('POST', url, headers=headers, data = payload). This question identifies the correct HTTP method and Python requests library usage for splitting a Cisco Meraki network via its API.
Question
Exhibit
Options
- Aresponse = requests.request('POST', url, headers=headers, data = payload)
- Bresponse = requests.request('PATCH', url, headers=headers, data = payload)
- Cresponse = requests.request('PUT', url, headers=headers, data = payload)
- Dresponse = requests.request('GET', url, headers=headers, payload = none)
How the community answered
(69 responses)- A80% (55)
- B10% (7)
- C3% (2)
- D7% (5)
Why each option
This question identifies the correct HTTP method and Python `requests` library usage for splitting a Cisco Meraki network via its API.
The Meraki API endpoint `/networks/{networkId}/split` is used to initiate the splitting of a combined network, which is an action that creates new resources or changes the state, making POST the appropriate HTTP method for this operation. The `requests.request()` function with 'POST' sends the request to the specified URL with the defined headers and payload.
PATCH is typically used to apply partial modifications to an existing resource, not to initiate a new action like splitting a network.
PUT is generally used to completely replace an existing resource or create a resource if it does not exist, which is not the primary purpose of splitting a network.
GET is used solely to retrieve data from a server and should not be used for modifying or initiating actions on resources.
Concept tested: Meraki API HTTP methods, Python requests
Source: https://developer.cisco.com/meraki/api-v1/#!split-network
Topics
Community Discussion
No community discussion yet for this question.
