Not able to connect to website URLs from Asp.Net WebApi Action Methods

后端 未结 1 1019
小鲜肉
小鲜肉 2021-01-15 13:15

I am trying to connect to URL using WebClient inside Asp.Net Web Api project. My intention was to get the content and create a web site thumbnail.

Sample Code:

相关标签:
1条回答
  • 2021-01-15 13:46

    I found the answer here in the end: Web Request through Proxy using RestSharp

    Adding:

    <system.net>
        <defaultProxy enabled="true" useDefaultCredentials="true"></defaultProxy>
    </system.net>
    

    To my web config fixed it for me.

    0 讨论(0)
提交回复
热议问题