Free 200-901 Exam Braindumps (page: 24)

Page 23 of 132

In Python, which expression checks whether the script returns a success status code when the Requests library is used?

  1. response.status_code == requests.codes.ok
  2. response.code == requests.codes.ok
  3. response.status_code == requests.ok
  4. response.status_code != requests.codes.ok

Answer(s): A


Reference:

https://realpython.com/python-requests/



Refer to the exhibit.


The script returns an output of 401. To use the supplied URL, an HTTP GET request must be sent with an Authorization header. The header value is a base64 encoded concatenation of the username and password. Which action must be taken to return an output of 200?

  1. Change the verify=False setting in the request to verify=True to enable HTTP Basic authentication.
  2. Verify that the username and password values imported from the configuration file are still valid.
  3. Insert an Authorization header with the values username:password from the supplied configuration file.
  4. Modify the method from LOGIN to GET and supply the username:password value as JSON payload.

Answer(s): B



Refer to the exhibit.



A Python code has been written to query a device. The executed code results in the error shown. Which action resolves the problem?

  1. import json
  2. requests('''?GET'''?, base_url + request_url, cookies=cookies)
  3. pip install requests
  4. import requests

Answer(s): D



Which REST architectural constraint indicates that no client context should be stored on the server between requests?

  1. cacheable
  2. stateless
  3. uniform interface
  4. client-server

Answer(s): B


Reference:

https://developer.cisco.com/docs/nx-os/#!representational-state-transfer-rest






Post your Comments and Discuss Cisco® 200-901 exam with other Community members:

200-901 Discussions & Posts