exam questions

Exam 300-735 All Questions

View all questions & answers for the 300-735 exam

Exam 300-735 topic 1 question 25 discussion

Actual exam question from Cisco's 300-735
Question #: 25
Topic #: 1
[All 300-735 Questions]


Refer to the exhibit. A network operator wants to add a certain IP to a DMZ tag.
Which code segment completes the script and achieves the goal?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: A

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
alainJ
Highly Voted 3 years, 10 months ago
D is the correct answer: see the requests documentation: https://docs.python-requests.org/en/latest/user/quickstart/#make-a-request you need first to serialize the value (convert it to python dictionary) in order to append the list, then you need to pass the dictionary as json (if you pass it as data=.. it will be url-form encoded, not json! - see the doc). If you want to pass the argument as data=... you need to first convert the value to string: data=json.dumps(...).
upvoted 5 times
...
zamkljo
Most Recent 2 years ago
D import requests import json d = {'a': 1} response = requests.post(url, data=json.dumps(d)) ********************************************** import requests import json d = {'a': 1} response = requests.post(url, json=d)
upvoted 1 times
...
hatsec
2 years, 6 months ago
B is correct
upvoted 1 times
...
Smileebloke
4 years, 3 months ago
B session.put uses 'data' parameter json.loads converts json value to python json.dump converts python string to json https://www.w3schools.com/python/python_json.asp
upvoted 2 times
...
digger_vce
4 years, 6 months ago
I think correct answer is C. JSON on input, we have to dump it to data to modify. And then we have to load it to JSON again.
upvoted 2 times
MerlinTheWizard
1 year ago
tag_session is a string at the end of the example
upvoted 1 times
...
...
dust09
4 years, 9 months ago
I'd say D. tag_session is a string so we need json.loads to convert to json
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...