1

Have made an angular js solution with the controllers designed as WepAPIs. When I test in my local the solution runs fine . But when i deploy to a server the WebAPI does not seem to give a correct response .

The request body and the api path is correct . Although i get a response code of 200 in the response of calling the API , the content type in the response is text/html; charset=utf-8 rather than JSON and my index page is being returned in the response as html.

Am I missing any server configuration ? Some server configuration has to be done for an WebAPI project ?

AR_Dev
  • 75
  • 2
  • 8
  • 1
    Sounds like you're getting an error page in response. Have you read it? –  Aug 03 '17 at 14:49
  • Also sounds like you might have your project/server configured to always return index.html, which in general is what you want except for where you make API calls and calls to retrieve other files. – Mike Feltman Aug 03 '17 at 14:50
  • Accept headers set right? https://stackoverflow.com/q/29944997/angularjs-http-custom-header-for-all-requests – Brian Aug 03 '17 at 14:59
  • Not sure if it helps someone else - I had this problem when I was concurrently running two versions of the same app in development env. – Ula Nov 20 '19 at 18:20

0 Answers0