Accessing APIs Using HttpClient in .NET
This course will teach you how to integrate with APIs using HttpClient in .NET.
What you'll learn
Integrating with a web API is a common task required by many applications. In this course, Accessing APIs Using HttpClient in .NET, you’ll learn to integrate your .NET applications with an API.
First, you’ll explore HttpClient internals and basic CRUD interaction.
Next, you’ll discover how to work with streams, consume a streaming API endpoint, work with compression, and how to cancel requests that are no longer needed.
Finally, you’ll learn how to improve the reliability of your requests and how to extend HttpClient with custom handlers.
When you’re finished with this course, you’ll have the skills and knowledge of using HttpClient needed to integrate your .NET application with an API.
Table of contents
- Version Check 2m
- Coming Up 1m
- Course Prerequisites 1m
- Frameworks and Tooling 2m
- Introducing the Demo Application 1m
- Demo: Introducing the Demo Application 5m
- Strategies for Working with DTO Model Classes 3m
- Generating DTO Classes 2m
- Demo: Generating DTO Classes from Visual Studio 6m
- Demo: Generating DTO Classes with NSWagStudio 7m
- Tackling Integration with HttpClient 7m
- Summary 2m
- Coming Up 1m
- Demo: Getting a Resource 12m
- Working with Headers and Content Negotiation 4m
- Demo: Manipulating Request Headers 4m
- Indicating Preference with the Relative Quality Parameter 1m
- Demo: Indicating Preference with the Relative Quality Parameter 2m
- Demo: Working With HttpRequestMessage Directly 3m
- Demo: Providing Default Values for HttpClient and JsonSerializerOptions 6m
- Demo: Creating a Resource 4m
- Setting Request Headers 2m
- Inspecting Content Types 1m
- Demo: Updating a Resource 2m
- Demo: Deleting a Resource 1m
- Demo: Using Shortcuts 2m
- Summary 3m
- Coming Up 1m
- The Problem with Disposing HttpClient Instances (Part 1) 2m
- Demo: The Problem with Disposing HttpClient Instances 4m
- The Problem with Disposing HttpClient Instances (Part 2) 1m
- Introducing HttpClientFactory 3m
- Using HttpClientFactory to Manage HttpClient Instances 2m
- Demo: Configuring HttpClients 5m
- Demo: Using Typed HttpClient Instances 3m
- Demo: Using Typed Instances with Type-scoped Configuration 1m
- Demo: Extending Typed Instances with Interaction Methods 4m
- Summary 2m
- Coming Up 1m
- Advantages of Working with Streams 4m
- Using Streams When Reading Data 1m
- Demo: Using Streams When Reading Data 4m
- Improving Memory Use and Performance with HttpCompletionMode 1m
- Demo: Improving Memory Use and Performance with HttpCompletionMode 2m
- Demo: Testing Performance Improvements When Getting Data 4m
- Using Streams When Sending Data 1m
- Demo: Using Streams When Sending Data 4m
- Using Streams When Sending and Reading Data 0m
- Demo: Combining Streams When Sending and Reading Data 1m
- Demo: Testing Performance Improvements When Posting Data 3m
- On Streams, Memory Use, and Performance 2m
- Summary 1m
- Coming Up 1m
- Delegating Handler Pattern 1m
- Implementing a Retry Policy 0m
- Demo: Implementing a Retry Policy with a Custom Delegating Handler 7m
- Unit Testing with HttpClient 1m
- Demo: Implementing a Custom Handler to Enable Unit Testing 3m
- Demo: Using a Custom Handler in a Unit Test 3m
- Additional Use Cases 1m
- Summary 2m