Simplifying HTTP invocations

The C# boilerplate code to (correctly) create an HTTP GET request is staggeringly complex. Async/await syntax, IDisposable objects, IHttpClientFactory dependency injection configurations, etc, etc, etc. This simple task is actually so complex to correctly implement that I've never seen it correctly done during my 20+ years as an enterprise software developer. In fact, even senior software developers often mess things up in these regards. In addition to getting the syntax correct, the developer needs to learn dozens of complex subjects before he can even start out wiring his code together; IoC, using patterns, HttpClient internals, etc, etc, etc. However, if you think about it, it shouldn't be all that hard. Purely from a syntactical point of view, nothing more than the following should be necessary.

Plain Text
 
http.get:"https://google.com"

The above of course is Hyperlambda, and the syntax for retrieving a URL using Magic. Interestingly, internally Magic will (of course) dispose objects, invoke the HTTP endpoint asynchronously, correctly wire up your IoC container, and use the IHttpClientFactory. The complexity of these parts are simply hidden, and completely irrelevant from the end developer's perspective. And before you ask, POSTing an object is just as simple.

CategoriesUncategorizedTags