exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 40 discussion

Actual exam question from Microsoft's 70-487
Question #: 40
Topic #: 1
[All 70-487 Questions]

DRAG DROP -
You are developing a .NET application that uses the HttpClient type to access an ASP.NET Web API application.
You need to add a header to specify that data is returned as JSON.
You have the following code:

Which segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the appropriate code segments to the correct location or locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
xjeroen
Highly Voted 5 years, 3 months ago
To clarify the difference: - Accept header is used by HTTP clients to tell the server which type of content they expect/prefer as response. - Content-type can be used both by clients and servers to identify the format of the data in their request (client) or response (server) and, therefore, help the other part interpret correctly the information. Since we are the calling client in this case we need to use the accept header to inform the server we want JSON. See https://stackoverflow.com/questions/35722586/header-parameters-accept-and-content-type-in-a-rest-context
upvoted 27 times
mr_
4 years, 10 months ago
That is really nice explanation.
upvoted 7 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...