I need to build a client for a web api in VBA and it needs to work behind a proxy (with authentication). I've been looking at the WinHttp.WinHttpRequest and MSXML2.XMLHTTP/ServerXMLHTTP classes. It turns out that:
- XMLHTTP automatically detects proxy settings provided through a proxy.pac file (good)
- WinHttpRequest doesn't (bad)
However, on the other hand:
- XMLHTTP automatically follows redirects, and there's no way of disabling this behaviour (bad)
- WinHttpRequest doesn't (good)
Since I'd like to be able to have my cake and eat it, is there a way to get automatic proxy configuration for a component such as WinHttpRequest that doesn't follow redirects blindly?
The VBA-Web project might help you with your pastry eating problem.
https://github.com/VBA-tools/VBA-Web
I guess what you wish to do would go something like: