zoukankan      html  css  js  c++  java
  • 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();
            }
        }
  • 相关阅读:
    项目Alpha冲刺Day7
    项目Alpha冲刺Day5
    项目Alpha冲刺Day6
    Alpha冲刺总结
    测试随笔
    项目Alpha冲刺Day12
    高校征信系统项目Postmortem结果
    冲刺合集
    总结随笔
    测试工作安排
  • 原文地址:https://www.cnblogs.com/mingjia/p/5462065.html
Copyright © 2011-2022 走看看