A campus team must enable a loopback description on IOS XE via RESTCONF using Python requests. Security mandates HTTPS with JSON payload, correct resource path, and proper CRUD verb without breaking existing interfaces. The first try returned 405 and 415 errors. Which RESTCONF URL, headers and methods using requests pattern should the script implement to update the interface?
Select an answer to reveal the explanation.
Short Explanation
RESTCONF is picky about the address and envelope, like a letter that needs the right destination and packaging. Send a PUT request to the exact interface resource with JSON Accept and Content-Type headers so IOS XE updates your interface without changing others.
Full Explanation
Use HTTPS, JSON request and response headers, and PUT on the individual interface resource. In RESTCONF, PUT replaces the representation at the addressed resource, making it appropriate when you intend to update that interface; the request body can include the loopback description and any other required interface data. A PUT to the interface resource with JSON Accept and XML Content-Type headers declares an XML request body, contradicting the requirement to send JSON. A PUT to the interfaces collection uses the right method and JSON headers but targets the collection rather than the specific existing interface, so the URI does not identify the resource to update. A POST to the interface resource uses the right URL and JSON headers, but POST is not the appropriate method for replacing that existing resource; it is commonly used to create a child resource under a collection. Exam caveat: PUT replaces the resource representation, so sending only a description field may remove or reset other interface properties; PATCH can be suitable for a partial change when supported, but the required method here is PUT. Practical check: inspect the final URL and request body, confirm the JSON media types and TLS certificate validation, and verify the response status and interface state afterward.