web.config

跨域请求:

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"></modules>
    <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" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>

html:

  <system.web>
    <httpRuntime targetFramework="4.5" maxRequestLength="40960" executionTimeout="720" requestValidationMode="2.0" />
  </system.web>
原文地址:https://www.cnblogs.com/zhangchaoran/p/8573386.html