Web Request through Proxy using RestSharp

后端 未结 4 647
谎友^
谎友^ 2020-12-14 19:43

I\'m trying to make a webrequest through a proxy on Windows phone 7. From what I can see the Compact Framework does not include the configuring of a proxy for the HttpWebReq

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 19:53

    This worked for me.

    String url = "some url";
    
    IWebProxy proxy = WebRequest.DefaultWebProxy;
    proxy.Credentials = CredentialCache.DefaultCredentials;
    RestClient client = new RestClient(url);
    {
    Proxy = proxy,
    };
    

提交回复
热议问题