how to set default proxy with .NET core 3.1 for HTTP client for any request?

泪湿孤枕 提交于 2020-12-13 03:37:17

问题


I am using interfax.api dll to send faxes to users. how I can add proxy server configurations to send the fax to users. actually I want to enable proxy server settings in .net core. what is best way to do it?


回答1:


the issue not seems to be with interfax api. this can be solved with adding proxy uri to your .net core project like that

HttpClient.DefaultProxy = new WebProxy("http://192.168.6.129:3128/", true);

in your startup class ConfigureServices method



来源:https://stackoverflow.com/questions/64931470/how-to-set-default-proxy-with-net-core-3-1-for-http-client-for-any-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!