一般的我们可以直接使用参数来接受,这个就不多介绍了 [HttpGet] public IHttpActionResult Test2([FromUri]string name) { object obj = new { name = "sss", age = , sex = true }; , data = obj }); } [HttpPost] public IHttpActionResult Test3([FromBody]string name) { throw new Exc
using System.IO; /// <summary> /// WebApi返回图片 /// </summary> public HttpResponseMessage GetQrCode() { var imgPath = @"D:\ITdosCom\Images\itdos.jpg"; //从图片中读取byte var imgByte = File.ReadAllBytes(imgPath); //从图片中读取流 var imgStream = new