Questions tagged [delegatinghandler]

36 questions
0
votes
1 answer

WebAPI - 404 Not Found (MapHttpRoute)

I'm trying to call ASP.NET Core APIs that starts with "webapi/v1" by using a ASP.NET WebAPI : I'm using a custom DelegatingHandler to handle "webapi/v1..." requests and call the APIs but only these URL Works: /webapi/v1/current ->…
moueidat
  • 529
  • 1
  • 7
  • 21
0
votes
1 answer

Web Api Handler for pre-request

I am using the Delegating Handler of Web Api 2.0 to intercept all my Web Api calls and I need to act before the action is executed. I implemented the code as explained on Microsoft Docs as following: public class MyHandler : DelegatingHandler { …
Raffaeu
  • 6,694
  • 13
  • 68
  • 110
0
votes
1 answer

HttpClient.SendAsync doesn't use DelegatingHandler when testing

We have a few classes in our C# project that make calls out to 3rd party APIs. We're using HttpClient objects for the calls. We've set up our classes where we do these calls to accept an HttpClient so that when testing, we can use a custom/fake…
M Kenyon II
  • 4,136
  • 4
  • 46
  • 94
0
votes
1 answer

Deadlock when calling LoadIntoBufferAsync in DelegatingHandler

To only zip / deflate WebAPI responses bigger than a given size limit, I have to find out the size of the content to be returned. However the following line: response.Content.LoadIntoBufferAsync() seems to cause a deadlock later in the API…
Philipp
  • 649
  • 2
  • 7
  • 23
0
votes
1 answer

How to define a DelegatingHandler for custom route?

I've created a DelegatingHandler and it works for every request. I've read some articles that i can define a handler for a specific route but I've tried a lot of ways without success, i'm missing something that i didn't found what is. The last…
user866364
-1
votes
1 answer

Modify RequestUri in C# WebApi

I have a ASp.Net WebApi and I add the DelegatingHandler for modify the requestUri. I tried some examples without results, It is possible? I Would like to encrypt (client) Decrypt (WebApi) part of the URL. In the WebApi exists the controller with the…
1 2
3