Do not delay calls ajax

I have a single-page ASP.NET MVC5 web application that uses angularjs to create ajax calls to an ASP.NET Web API 2 application, all of which are visible on the Chrome Developer Tools tab. However, Glimpse does not capture ajax calls, neither in the HUD, nor in the Ajax tab. I added application/jsonto view content types in web.config. I also added a header X-Requested-Withto my ajax calls for angularjs:

$httpProvider.defaults.headers.common = { 'X-Requested-With': 'XMLHttpRequest' };

However, the HUD continues to show 0 ajax requests, and there is nothing on the Ajax tab. Is there anything else I should do? How to fix this problem?

+4
source share
2 answers

, , - :

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <runtimePolicies>
      <statusCodes>
        <add statusCode="201" />
        <add statusCode="202" />
        <add statusCode="203" />
        <add statusCode="204" />
        <add statusCode="404" />
      </statusCodes>
    </runtimePolicies>
</glimpse>

Glimpse AJAX X-Requested-With: XMLHttpRequest. AngularJS $http , AJAX Glimpse. $httpProvider, ...

app.config(['$httpProvider', function ($httpProvider) {
    $httpProvider.defaults.headers.common = { 'X-Requested-With': 'XMLHttpRequest' };
}]);

: http://anthonychu.ca/post/getting-angularjs-http-and-web-api-to-work-with-glimpse ( , )

+5

, glimpse pace.js. ajax.

javascript, ajax, , . , pace.js (, ).

+2

Source: https://habr.com/ru/post/1548167/


All Articles