Reputation: 601
I have created a Web API, added a JSON formatter, and when I call the method URL while debugging on my local machine the database data appears in JSON format. So far, so good. When I publish the Web API to my web host and I enter the same URL (modified for the domain name) I get this error message:
{"Message":"An error has occurred."}
I look at the Network Response in Developer Tools and it says the same thing. What more can I do to debug this? Can you guess what is causing this error on my web host?
UPDATE: Doing a little more testing I see that calls that return a single JSON object work from my domain name, but when it is an array of JSON objects the calls work locally, but not when I deploy them to my web host and call them from my domain name.
Upvotes: 0
Views: 2670
Reputation: 601
I got this to work by switching web hosts. GoDaddy was the problem. It was not allowing the javascript to request the JSON object. It worked first time on the new web host with no problems. Adios GoDaddy
Upvotes: 1