200-901 Software Development and Design Practice Question
When using the requests library in Python to send a POST request, which parameter should be used to send a JSON payload in the request body?
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
✓
json=payload
The json= parameter automatically serializes the Python dictionary to JSON and sets the Content-Type header to application/json.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
params=payload
Why it's wrong here
params=payload appends the data as URL query-string parameters, not a request body, so the server receives no JSON payload. It is tempting because params is the natural argument for GET query data, and would be correct when sending filter values in the URL rather than a JSON body.
- ✗
files=payload
Why it's wrong here
The files parameter builds a multipart/form-data body for file uploads, so the JSON payload would be encoded as a file part rather than raw JSON. It is tempting when uploading documents alongside metadata, where multipart encoding is genuinely required.
- ✓
json=payload
Why this is correct
The json= parameter serialises the Python dictionary to JSON and sets the Content-Type header to application/json automatically, placing the payload in the request body. Passing data= would form-encode it instead, so json= satisfies the JSON body requirement.
- ✗
data=json.dumps(payload)
Why it's wrong here
Passing a pre-serialised string to data sends it with no Content-Type header, so the server sees text, not JSON. It is tempting because manual serialisation works when you also set headers explicitly, but json= handles encoding and header together.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 975 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.