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 ?

4
  • 1
    Sounds like you're getting an error page in response. Have you read it? Commented Aug 3, 2017 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. Commented Aug 3, 2017 at 14:50
  • Accept headers set right? stackoverflow.com/q/29944997/… Commented Aug 3, 2017 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. Commented Nov 20, 2019 at 18:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.