首页 > 代码库 > ASP.NET Web Api
ASP.NET Web Api
1、参考资料
Routing in Asp.NET Web Api:
http://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-in-aspnet-web-api
http://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-and-action-selection
Return Json Format
http://www.cnblogs.com/jiguixin/p/3230645.html
向Web Api 传递参数
http://www.cnblogs.com/Juvy/p/3903974.html
http://www.tuicool.com/articles/fuIjeaf
http://www.cnblogs.com/smiler/p/3144018.html
Http Cookies in Asp.Net Web Api
http://www.asp.net/web-api/overview/advanced/http-cookies
2、Web Api开启Sessioin功能
Global.asax.cs添加内容
public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); } /// <summary> /// 重写Init方法并设置会话行为类型 /// </summary> public override void Init() { this.PostAuthenticateRequest += (sender, e) => HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Required); base.Init(); } }
ASP.NET Web Api
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。