.net core webapi 读取php 接口 方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_41600552/article/details/83589059

      引用命名空间

     using System.Net;

      [HttpPost("api/get")]
        public string  Get()            
        {
           
            WebClient wc = new WebClient();     //最主要是该类
            var result = wc.DownloadString("url");
            //就是调用接口后得到的返回值
            return result;

        }

猜你喜欢

转载自blog.csdn.net/weixin_41600552/article/details/83589059