Based on the security requirements, which line of code should you insert into the WebApiConfig file?

Posted by: Pdfprep Category: 70-487 Tags: , ,

HOTSPOT

ReportApp will shut down every night.

However, data from the searches performed during the night must still be collected.

Based on the security requirements, which line of code should you insert into the WebApiConfig file? To answer, select the appropriate options in the answer area.

Answer:

Explanation:

Scenario: The Web API must only accept one data format.

The MVC front-end layer and the Web API will communicate by using JSON.

The most common approach to support JSON only is to clear other formatters and leave only JsonMediaTypeFormatter around.

Given an instance of HttpConfiguration you’d simply clear all and re-add

JsonMediaTypeFormatter:

configuration.Formatters.Clear();

configuration.Formatters.Add(new JsonMediaTypeFormatter());

References: http://www.strathweb.com/2013/06/supporting-only-json-in-asp-net-web-api-the-right­way/

Leave a Reply

Your email address will not be published.