MVC Webapi Ajax error on type-approval server only

Asked

Viewed 358 times

0

I have a mvc page that calls a method in the webapi (another project within the solution), it turns out that in the localhost everything works normally, when it will homologation, when calling the method in the api, it excuta everything correctly, does what it has to do, but the return of ajax comes as error, only as msg error ( even doing what you have to do) Can someone help me? Obs: Remembering that the method worked on the localhost, only on the homologation server is giving error ( error, but even with error executes the method ) called ajax:inserir a descrição da imagem aqui

Method in api:

inserir a descrição da imagem aqui

  • What is the error returned?

  • When I looked at the error return: only xhr is filled with the text "error" and nothing else, I did the test running the localhost application and pointing to the api that is on the homologation server

  • Have you tried using a REST tool that triggers this request for you and gives you a more complete error?

  • Tip: code post instead of images code. If by chance someone has to reproduce the error, they will not be able...

  • I’ll post the code I’m sorry,I just thought it looked visually better rsrs

1 answer

0


I discovered the problem, it turns out that in localhost ,the domain was the same for the webApi project and for the Website, when I published in homologation the domain was different causing the problem of the return of the ajax, I ended up leaving the webApi along with the design of the website, when publishing the domain it was the same for both and no ajax error occurred, Thanks for your help, guys.

  • Mark your answer as answered.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.