200-901 exam dumps

200-901 practice question 46 of 204

Cisco DevNet Associate. Associate level, Cisco. Free question with the correct answer and a full explanation.

200-901 Question 46

Single answer

You are developing an application that interacts with a REST API. While testing a POST request to create a new resource, the server responds with a 400 Bad Request error. The API documentation specifies that the 'Content-Type' header must be set to 'application/json', and the request body should include 'name' and 'description' fields. Upon reviewing your request, you notice that the 'Content-Type' header is set to 'text/plain'. What is the most likely cause of the error?

  1. A

    The 'Content-Type' header in the request is incorrect.

  2. B

    The API endpoint does not support POST requests.

  3. C

    The server is experiencing an internal error.

  4. D

    The request body is missing required fields.

Show answer and explanation

Correct answer: A

Explanation

A 400 Bad Request error typically means there is an issue with the client's request. In this scenario, the API documentation specifies a required 'Content-Type' header of 'application/json'. Since the request header incorrectly uses 'text/plain', the server rejects the request. Ensuring the correct 'Content-Type' resolves the issue.

  • A. Correct.

    Correct. The API documentation explicitly states that the 'Content-Type' header must be set to 'application/json', but the request uses 'text/plain', causing the 400 Bad Request error.

  • B. Incorrect.

    Incorrect. The error code 400 indicates a client-side issue, not that the POST method is unsupported by the API.

  • C. Incorrect.

    Incorrect. A 400 Bad Request error does not indicate a server-side issue like a 500 Internal Server Error would.

  • D. Incorrect.

    Incorrect. While missing fields could cause a 400 error, the question specifies that the issue lies with the 'Content-Type' header.

Timed practice exam

Take a 200-901 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam