filmov
tv
Request-Response in .NET with HttpClient Every Developer Should Know | HOW TO - Code Samples

Показать описание
#coding #codingbootcamp #softwaredeveloper #CodeYourFuture
Introduction
The Request-Response pattern is everywhere: from web protocols like HTTP, DNS, or SSH to database protocols and APIs. It is the most basic, classic communication pattern and a crucial building block of any web application.
In this video, we will cover sending Requests using the standard HttpClient and receiving them using an ASP.NET Core REST API.
The HTTP Request-Response Model
The HTTP Request/Response is a simple synchronous pattern.
It consists of a sender sending an HTTP request and keeping the connection open until the receiver responds or the request times out.
There have been many ways to achieve Request-Response over HTTP throughout the history of .NET (like WCF and SOAP), but most modern apps today use REST APIs.
REST
REpresentational State Transfer is an architectural style for building stateless, reliable web APIs. This means that, unlike protocols like SOAP or gRPC, there is no standard to adhere to, but rather a set of constraints that are widely adopted and that you should follow if you want your API to be RESTful.
Despite that, a de facto standard communication protocol for REST APIs is HTTP/1.1 since browsers mostly don’t support HTTP/2, and the message format is JSON.
Conclusion
I have shown you how to send HTTP requests in .NET using the standard HttpClient and set up endpoints for an ASP.NET Core API.
Lots of Great How Tos and Code Samples! Make sure to like and subscribe!