API Testing · Junior · Question 29 of 75
What does this curl command do?
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Ann"}'- 1Sends a POST with a JSON body to create a user
- 2Deletes the user named Ann from the server
- 3Downloads the list of users into a JSON file
Show the answer
Correct answer: Sends a POST with a JSON body to create a user
Explanation
-X sets the method, -H adds a header and -d sends the body. Adding a curl command to a bug report lets anyone reproduce it.