I have a C# windows forms application and one third party dll do some API calls to a server where I want to intercept the HTTP request going from my application and add a custom header by updating the request.
Is that possible to do in WinForms/C# without using a proxy service? If so how do I intercept the request being sent from my application?
            Asked
            
        
        
            Active
            
        
            Viewed 662 times
        
    3
            
            
         
    
    
        ganchito55
        
- 3,559
- 4
- 25
- 46
 
    
    
        shashika nirmani
        
- 37
- 5
- 
                    1Have you seen [this answer](https://stackoverflow.com/a/35910012/2309376)? – Simply Ged May 21 '19 at 04:12
- 
                    yes but it's not what I want as my server api call hasn't a way to add authentication header I want to fire an event when each api call occurs and before request sent to server I need to update the request with adding an authentication header – shashika nirmani May 21 '19 at 05:13
- 
                    Are you saying you want to be able to do this without modifying the application itself ( which would make it rather simple)? – John Wu May 21 '19 at 05:26
- 
                    yes as the server api couldn't change I need a way to add authorization header with intercepting the HTTP traffic that going from my application.is that possible? – shashika nirmani May 21 '19 at 05:32