[HttpPost]
public HttpResponseMessage Upload()
{
	string json = "{\"result\":\"true\"}";
	return new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") };
}



//生成web api帮助文档help  参数1数据  参数2类型 参数3控制器名 参数4Action名
//\Areas\HelpPage\App_Start\HelpPageConfig.cs   Register方法中新增对应的sample
config.SetSampleResponse(AliExpress.Sample.CateSample.CateGetData(), new MediaTypeHeaderValue("application/json"), "Cate", "Get");


本文转载:CSDN博客