0

When I deploy (or debug) the App and I call a REST service (retrieving list items) I get always

500 Internal Server Error, Unknown Error

Maybe I tried to get the items before that the list has been created? Do you have any ideas? How can I debug this problem?

2
  • 1
    You could perhaps check ULS. Also, are you querying host web app? And lastly, how does your request look like
    – eirikb
    Apr 16, 2014 at 10:12
  • If I refresh the page it works fine. My request is executed in a $.ajax call and looks like: myURL/_api/web/lists/getByTitle('MyLists')/items?
    – Nk SP
    Apr 16, 2014 at 10:15

2 Answers 2

1

Since you mentioned that are using jQuery.ajax, you could print the error details using error handler as demonstrated below:

$.ajax({
        url: siteurl + "/_api/web/lists/getbytitle('" + listName + "')/items",
        method: "GET",
        headers: { "Accept": "application/json; odata=verbose" },
        success: function (data) {
            //...
        },
        error: function (data) {
            console.log(JSON.stringify(data));
        }
});

or leverage the Fiddler tool to trace and diagnose REST requests.

enter image description here

1
  • Helped to debug the problem.(error in the list xml schema definition). Thanks
    – Nk SP
    Apr 18, 2014 at 6:59
0

go to the IIS logs and see if more information is given about the 500 error code. I have see this error when I want to work with REST and I see IIS log and know that Actually there was problem in behaviour configuration at sevice side and then the way params I was passing at client end has problem.
So I hope this usefull!

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.