Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

$
0
0

hi,

I am trying to follow this tutorial :https://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api , just renamed products to planes 

This part work ok :   

    var uri = 'api/planes';

var id = $('#planeId').val();
      $.getJSON(uri + '/' + id)

But I see a error with the 'Get' 

status of 500 (Internal Server Error) is seen when the page loads .  Any tips how to debug this ?

http://localhost:1926/index.html   ,  calls the C# Get method

    public class PlanesController : ApiController
    {
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        Plane[] planes = new Plane[]
        {etc

Thanks,Peter


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>