exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 46 discussion

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



Refer to the exhibit. Which line of code must be added to this code snippet to allow an application to pull the next set of paginated items?

  • A. requests.get(url, links=['next']['url'])
  • B. requests.get(url, headers=links['next']['url'])
  • C. requests.get(res.links['next']['url'], headers=headers)
  • D. requests.get(res.headers.get('Link')['next']['url'], headers=headers)
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
tommiy
Highly Voted 1 year, 8 months ago
C. https://docs.python-requests.org/en/master/user/advanced/#link-headers
upvoted 10 times
...
designated
Most Recent 9 months, 4 weeks ago
Selected Answer: C
C is correct: url=response.links["next"]["url"] One method is using the HTTP “Link” header, which provides a list of resources (URLs) and the type of relationship between a resource and the current page, defined in the “rel” parameter. The client can use links and relationships to navigate through the data. The requests library automatically parses “Link” headers and makes them easily consumable as the “links” property of the Response object.
upvoted 3 times
...
mairo3000
1 year, 2 months ago
Selected Answer: C
agree with C
upvoted 2 times
...
jjkcoins
1 year, 8 months ago
D. The script uses res.headers.get method to access the links header... so we use the same method to get the next url from the response headers. The requests library has no links method in a response object.
upvoted 2 times
jjkcoins
1 year, 8 months ago
D Disregard above. res.links is a valid method in a response object.
upvoted 1 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