Practicing and exploring
Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring this chapter’s topics with deeper research.
Exercise 15.1 – Test your knowledge
Answer the following questions:
- Which class should you inherit from to create a controller class for an ASP.NET Core Web API service?
- When configuring an HTTP client, how do you specify the format of data that you prefer in the response from the web service?
- What must you do to specify which controller action method will be executed in response to an HTTP request?
- What must you do to specify what responses should be expected when calling an action method?
- List three methods that can be called to return responses with different status codes.
- List four ways that you can test a web service.
- Why should you not wrap your use of
HttpClient
in ausing
statement to dispose of it when you are finished even though...