Add httpClient abstractions SendRequestStatusToGetASmokeAlarm
See original GitHub issueAt the moment we are missing proper abstractions SendRequestStatusToGetASmokeAlarm
class.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Web Service Integrations Using Hangfire in ASP.NET Core
Using Hangfire's Enqueue method, I set up a job ( IProcessApiRequests ) that would create a Request entity in our database from the ......
Read more >noamyogev84/HttpClient.Abstractions
Abstractions is a lightweight package providing a complete abstraction over System.Net.Http.HttpClient. The package consists of: Abstraction layer supporting ...
Read more >Make HTTP requests using IHttpClientFactory in ASP.NET ...
Learn about using the IHttpClientFactory interface to manage logical HttpClient instances in ASP.NET Core.
Read more >Use the IHttpClientFactory - .NET
Learn how to use the HttpClient and IHttpClientFactory implementations with dependency injection in your .NET workloads.
Read more >Unable to resolve service for type 'System.Net.Http.HttpClient'
After adding this DI in my Azure Function, I was getting the error mentioned below. Microsoft.Extensions.DependencyInjection.Abstractions: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Forgive me if this is already taken care of architecturally, but that sounds like a very campaign specific method name to me.
Should we be placing such campaign specific code in the application, and if so, should we be treating it as a campaign specific add-in?
I would check, but I am using a mobile phone at the moment…
@chinwobble, the problem with using the IHttpClient abstraction on this one (and why I haven’t moved to it yet) is b/c of the http headers involved in putting the auth token onto the POST request. At least that was my reasoning when I wrote it.
I just did a quick search around and it looks like TwitterService uses the IHttpClient static instance in a POST scenario. Instead of attaching the http headers to the client, it builds an HttpRequestMessage and attaches the headers to the request, then sends the request via HttpClient. In other words, HttpClient stays “header agnostic”, which it should as it’s a static instance, it will be used for both GET and POST scenarios and we would not want to attach headers to the client for an instance where it’s being used in the wrong call.
If you’d like to have a go at changing SendRequestStatusToGetASmokeAlarm to utlizie the static IHttpClient like TwitterService does, please do and let me know how it goes.