Here's a list of all codes referenced by name in the .codes object:
https://2.python-requests.org/en/master/api/#status-code-lookup
"Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, codes.ok, codes.OK, and codes.okay all correspond to the HTTP status code 200."
A is correct
response.status_code == requests.code.ok
response + status_code from library equals requests imported . code from requets library and response code ok
correct, but not pythonic:
>>> if response.status_code == requests.codes.ok:
... print("ok")
...
ok
>>> if response.status_code:
... print("ok")
...
ok
>>>
Wrong. Every status code, not only 200, would trigger that condition.
upvoted 3 times
...
...
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
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.
afsarmahmood
Highly Voted 2 years, 3 months agoanagy11
Most Recent 7 months, 2 weeks agodesignated
8 months, 2 weeks agopsyborg
2 years, 2 months agoIamrandom
11 months ago