基于.NET CORE的微光互联二维码扫描器接口写法

研究了两天 记录下

 		 /// 
        /// 接收二维码
        /// 
        /// 
        [HttpPost]
        [ApiExplorerSettings(GroupName = "core")]
        public string getqrcord()
        {
            //获取字符流
            Stream stream = HttpContext.Request.Body;
            byte[] buffer = new byte[HttpContext.Request.ContentLength.Value];
            stream.Read(buffer, 0, buffer.Length);
            string content = Encoding.UTF8.GetString(buffer);
            Logs.WriteLog("qrcode", content, hostingEnvironment);
            //返回字符流
            return "code=0000";
        }

你可能感兴趣的:(ASP.NET)