繁体   English   中英

Web API Null Content C# from Postman

[英]Web API Null Content C# from Postman

这么努力的尝试。 Been calling a function API from Postman but when I tried to check the content it is null and the method is GET but I have set to POST.

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

这是接收代码

  [System.Web.Http.HttpPost()]
        // POST: Stream_Technical
        public void Update_Activation(HttpRequestMessage request)
        {
            

      
        
            string message = request.Content.ReadAsStringAsync().Result;
            

        }

像这样改变你的方法

   [HttpPost("collection")]
    // POST: Stream_Technical
    public void Update_Activation([FromBody]HttpRequestMessage request)
    {



        string s = JsonConvert.SerializeObject(request);
      //  string message = request.Content.ReadAsStringAsync().Result;


    }

这里我还附上了截图在此处输入图像描述

邮递员请求在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM