a
/// <summary> /// 接收字符串或者xml /// </summary> /// <returns></returns> [HttpPost] public async Task<JsonResult> AcceptXMLOrString() { var len = Convert.ToInt32(HttpContext.Request.ContentLength); byte[] byt = new byte[len]; var ri = HttpContext.Request.BodyReader.AsStream().Read(byt, 0, len); var str = Encoding.UTF8.GetString(byt, 0, len); ApiResult<string> result = new ApiResult<string>() { errorCode = "0", message = "success", data = str }; return new JsonResult(result); }
标签:xml,byt,len,字符串,api,var,new,net From: https://www.cnblogs.com/xsj1989/p/18061136