Kizspy | Question: 43
(Choose 1 answer)
You want to send a request to "
https://api.example.com/submit" with JSON data {"name": "John", "age": 30}.
Which of the following code snippets correctly sends this request, note that you do not want to show the data
on URL?
A. response = requests.post("
https://api.example.com/submit", json={"name": "John", "age":30})
B. response = requests.post("
https://api.example.com/submit", params={"name": "John", "age": 30})
C. response = requests.get("
https://api.example.com/submit", json={"name": "John", "age":30})
D. response = requests.get("
https://api.example.com/submit", params={"name": "John", "age": 30})