Web Connection
Accessing the REST API with jQuery
Gravatar is a globally recognized avatar based on your email address. Accessing the REST API with jQuery
  Scott Malinowski
  All
  Jun 15, 2017 @ 03:01pm

Greetings!

I am working through the Step by Step: Creating a JSON REST Server/Step 8 - Accessing the REST API with jQuery. When I click on Load Customers, I get this error:

As you can see in the Chrome Dev window, the data is loading ok and the JSON objects have a property called firstname. I tried changing all references to the firstname in the HTML and JS files to lowercase, but that did not make a difference.

Any ideas?

Thanks!

Scott M.

Gravatar is a globally recognized avatar based on your email address. re: Accessing the REST API with jQuery
  Rick Strahl
  Scott Malinowski
  Jun 16, 2017 @ 01:19pm

Case is important. firstName and firstname are not the same.

I think if I recall the demo on the server uses cPropertyNameOverrides to force the JSON to its proper case. Looks like you might be missing that.

This (in Step 5):

cCustomerCapitalizations = "firstName,lastName,careOf"
...
Serializer.PropertyNameOverrides = this.cCustomerCapitalizations

+++ Rick ---

© 1996-2024