×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

Question about HttpClient

HttpClient client = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true });
client.BaseAddress = new Uri(ConfigurationManager.AppSettings["SrvcBaseAddr"]);

in the web.config:

<add key="SrvcBaseAddr" value="http://localhost:61788/" />

Is port 61788 special?
If I changed it to other values, such as 61988. When I run the web application, it still use 61788.

??? what's problem.
The company can't input Chinese, so I use english.
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / Question about HttpClient
    HttpClient client = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true });
    client.BaseAddress = new Uri(ConfigurationManager.AppSettings["SrvcBaseAddr"]);

    in the web.config:

    <add key="SrvcBaseAddr" value="http://localhost:61788/" />

    Is port 61788 special?
    If I changed it to other values, such as 61988. When I run the web application, it still use 61788.

    ??? what's problem.
    The company can't input Chinese, so I use english.
    • 自己回答一下。 Web API 的project 设定用这个端口。