
We shouldn’t forget to validate our JSON data! There’s an online JSON Validator tool called JSONLint that can be used to validate JSON files. This is the best and most reliable option. The data is supplied in the form of an object, which leaves the task of creating the query string (or transmitting the request body) up to jQuery.
#Convert html form to json helper function code#
The exact status code is API-dependent, but for most GET requests, a status code of 200 is usual. Here we check the status to ensure that the result is indeed the object returned from a successful request and not some object containing an error message. In this case, a potential success callback would look like this: function success ( data ) ) In the simplest scenario, we only care about the returned object.

