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();
            }
        }
  • 相关阅读:
    计算机网络通信
    javap查看class文件
    JDK动态代理与CGLib动态代理
    error the @annotation pointcut expression is only supported at Java 5 compliance
    redis清空缓存
    利用HttpURLConnection发送请求
    linux下用命令导出mysql表数据
    adb push和pull使用
    mysqld.exe占比cpu 100% 解决方案
    养成好习惯
  • 原文地址:https://www.cnblogs.com/mingjia/p/5462065.html
Copyright © 2011-2022 走看看