Home » Microsoft » 70-487 v.2 » How should you complete code?
DRAG DROP
You are developing a Microsoft ASP.NET Web API.
You need to create a method to answer to the following raw HTML request.
How should you complete code? To answer, drag the appropriate code segments to the correct locations. 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.
NOTE: Each correct selection is worth one point.
Select and Place:
Correct Answer:
Explanation/Reference:
References: https://docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/action-results
https://docs.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-2.2&tabs=visual-studio#add-get-methods
Why use Get ? Can explanation it ?
1. HttpResponseMessage
2. Post
3. FromBody
Correct
Now come on, this is an easy one. Get? Seriously?
It should obviously be Post!