exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 291 discussion

Actual exam question from Cisco's 350-901
Question #: 291
Topic #: 1
[All 350-901 Questions]



Refer to the exhibit. Which code snippet must be added to the blank in the code to automate the evaluation and handling of errors due to wrong credentials when Basic Authorization is used?

  • A. while response.status_code == 401 :
  • B. while response.status_code == 403 :
  • C. while response.get.status_code == 400 :
  • D. while response.get.status_code == 404 :
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
hatsec
Highly Voted 1 year, 3 months ago
A is correct: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
upvoted 12 times
...
SzClar
Most Recent 1 year, 3 months ago
B is correct. in the 3rd line it says "please login again" which means 403 has been returned. on the page provided by hatsec "This status code is similar to the 403 Forbidden status code, except that in situations resulting in this status code, user authentication can allow access to the resource."
upvoted 1 times
kirrim
6 months, 3 weeks ago
403 Forbidden means that the user has logged in with the correct, valid credentials, but is not allowed to access whatever they are attempting to access. 401 Unauthorized means that their credentials are invalid, which is the trigger for the error message you are attempting to generate in the exhibit code snippet.
upvoted 3 times
...
[Removed]
1 year, 2 months ago
Don't overcomplicate things. A is correct.
upvoted 8 times
xChdjdufurpew
1 year, 2 months ago
hahahaha
upvoted 1 times
i9t6
10 months, 2 weeks ago
KISS Principle
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago