200-901 Software Development and Design Practice Question
A developer needs to create a Python script that makes a GET request to a REST API to retrieve a list of network devices. The API uses query parameters to filter by device type and status. Which TWO code snippets correctly include query parameters using the requests library? (Choose two.)
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
requests.get('https://api.example.com/devices', params={'type': 'router', 'status': 'active'})
The params parameter accepts a dict; also can pass dict directly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
requests.get('https://api.example.com/devices', params={'type': 'router', 'status': 'active'})
Why this is correct
Correct use of params.
- ✗
requests.get('https://api.example.com/devices', data={'type': 'router', 'status': 'active'})
Why it's wrong here
data is for request body, not query parameters.
- ✓
requests.get('https://api.example.com/devices?type=router&status=active')
Why this is correct
Manually constructing query string is also valid.
- ✗
requests.get('https://api.example.com/devices', json={'type': 'router', 'status': 'active'})
Why it's wrong here
json parameter sends JSON in body, not query.
- ✗
requests.get('https://api.example.com/devices', headers={'type': 'router', 'status': 'active'})
Why it's wrong here
Headers are for metadata, not query parameters.
Go deeper
Related to this question
About these practice questions
One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.