How to use http post with proxy support in c#

后端 未结 3 1113
面向向阳花
面向向阳花 2020-12-28 21:39

How to use http post with proxy support in c# and multipart form data upload method

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 22:32

    If the web request works fine in your localhost with default proxy and not working in your web server, then you have to set your company's approved proxy and also whitelist the URL you are connecting to from your web application in the web server.

    You can mention the proxy settings either in web.config or in code.

    
      
        
      
    
    

    (or)

    HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("URL");
    wr.Proxy = new WebProxy("companyProxy",Portnumber);
    wr.Method = "POST";
    

提交回复
热议问题