• .net webapi跨域 web.config配置


    <system.webServer>
    
    <httpProtocol>
    
    <customHeaders>
    
    <add name="Access-Control-Allow-Origin" value="*" />
    
    <add name="Access-Control-Allow-Headers" value="Content-Type" />
    
    <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
    
    </customHeaders>
    
    </httpProtocol>
    
    <handlers>
    
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    
    <remove name="OPTIONSVerbHandler" />
    
    <remove name="TRACEVerbHandler" />
    
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    
    </handlers>
    
    </system.webServer>
    <system.webServer>
        <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="1048576000"></requestLimits>
          </requestFiltering>
        </security>
    
        <httpProtocol>
          <customHeaders>
            <add name="Access-Control-Allow-Headers" value="x-requested-with" />
            <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS,DELETE,PUT" />
            <remove name="X-Powered-By" />
          </customHeaders>
        </httpProtocol>
    
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="WebDAVModule" />
        </modules>
    
    
        <staticContent>
          <remove fileExtension=".woff" />
          <remove fileExtension=".woff2" />
          <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
          <mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
        </staticContent>
        <handlers>
          <remove name="WebDAV" />
          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <remove name="OPTIONSVerbHandler" />
          <remove name="TRACEVerbHandler" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
      </system.webServer>
  • 相关阅读:
    python操作mysql
    django 模型
    sox应用实例:平分一个音频文件
    Python list的各种删除元素操作
    Python sort() 和 sorted() 的区别
    Linux去除文件名中的空格
    合并多个MP4文件
    把wav文件等时长切割
    删除文件里的重复行
    Shell 截取字符串
  • 原文地址:https://www.cnblogs.com/eedc/p/11314668.html
Copyright © 2020-2023  润新知