4

We have a Web API that has an action that returns BadRequest() which is a 400.

the call to the API looks like this:

$.post("/api/controller/action", {test:"Bad data"}).success(function(data){

    console.log(data)

});

the API Controller Action method returns an IHTTPActionResult of BadRequest("Invalid data recieved"); The Chrome inspector verifies the return was a 400, Fiddler verifys 400, but jQuery runs its success method and console.log(data); shows us that data.status = 240.

I do not think its just jQuery, because AngularJS's $http service does the exact same thing.

Victorio Berra
  • 2,760
  • 2
  • 28
  • 53

1 Answers1

1

I got this fixed by removing all suspicious extensions from both Chrome and Firefox. I realized i had Trovi installed, which is a virus causing some redirections (apparently). So turned out to be 3rd party software fiddling with my browsers.

Follow this link to clean your PC: http://www.anvisoft.com/resources/how-to-remove-trovi-com-browser-hijacker-trovi-com-removal-guide/

Same Postman call as before now correctly shows me 400 Bad Request instead of 240.

Grzegorz Kaczan
  • 21,186
  • 3
  • 19
  • 17