none
.Net core Web api 2 - Delegating handler or middleware RRS feed

  • Question

  • I am working on Web api 2 (.NET Core 2). I need to develop some wrapper kind of web api which calls some third party web api. So my code will need Httpclient to consume third party web api and it will serve as web api itself as well.Some of the third party web api needs Hmac Authentication so I need to customize my Authorization header and add hash value to it.Initially I was thinking to create middleware for this but then read about delegating handler and HttpClientFactory. Now I somehow confused between delegating/message handler and middleware in web api.

    I also read that delegating handler are gone in .net core but then HttpClientFactory is available in .net core which takes delegating handler. Could anybody clarify?

    Could anybody please suggest that for my scenario(implementing Hamc Authentication and send authorization request header to call third party web api) 

    1) What should I use delegating handler or middleware? 
    2) If delegating handler is not gone for .net core, When delegating handler should be used and when middleware should be used

    • Moved by May Luo-MSFT Friday, November 2, 2018 7:14 AM off-topic issue
    Friday, November 2, 2018 12:44 AM

All replies

  • Hi VibhutiChavada,

    Welcome to the MSDN forum.

    Based on your description, it seems be related to ASP .NET core issue. Since our forum is mainly discussing with .NET Framework Setup and Servicing issue. I recommend you redirect to the ASP .NET core forum and start a new thread to share your question for a more professional supporting.

    Thank you for your understanding.

    Best Regards

    May


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, November 2, 2018 7:12 AM