question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add httpClient abstractions SendRequestStatusToGetASmokeAlarm

See original GitHub issue

At the moment we are missing proper abstractions SendRequestStatusToGetASmokeAlarm class.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mjmilancommented, Jan 27, 2017

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…

1reaction
mgmccarthycommented, Jan 25, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found