nerdexam
Cisco

300-435 · Question #158

Refer to the exhibit (Python code above). A Python script for vManage API calls fails with HTTP 400. Which action resolves the issue?

The correct answer is B. Use required syntax for the URL address. An HTTP 400 Bad Request error from a vManage API script indicates the URL is malformed or uses incorrect syntax, which is resolved by correcting the URL format.

Controller-Based Network Automation

Question

Refer to the exhibit (Python code above). A Python script for vManage API calls fails with HTTP 400. Which action resolves the issue?

Options

  • AImport the necessary modules into the script.
  • BUse required syntax for the URL address.
  • CDefine the environment variables.
  • DChange the access level.

How the community answered

(29 responses)
  • A
    7% (2)
  • B
    90% (26)
  • C
    3% (1)

Why each option

An HTTP 400 Bad Request error from a vManage API script indicates the URL is malformed or uses incorrect syntax, which is resolved by correcting the URL format.

AImport the necessary modules into the script.

Missing module imports would cause a Python ImportError or NameError before the HTTP request is even made - they would not result in an HTTP 400 response.

BUse required syntax for the URL address.Correct

HTTP 400 Bad Request is returned by the server when it cannot process the request due to malformed syntax, which in this context means the URL address does not conform to the required format for the vManage API endpoint. Correcting the URL structure to match the API specification resolves the 400 error and allows the request to be processed successfully.

CDefine the environment variables.

Undefined environment variables would raise a Python KeyError or return None before the request executes, not produce an HTTP 400 from the server.

DChange the access level.

Insufficient access level would return HTTP 403 Forbidden, not HTTP 400 Bad Request.

Concept tested: HTTP 400 error diagnosis for malformed API URL

Source: https://developer.cisco.com/docs/sdwan/

Topics

#vManage API#Python#API Debugging#HTTP Status Codes

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice