This is the JSON I am trying to read:
[{
"model": "catalog.product",
"pk": 2476,
"fields": {
"created": "2016-10-04T05:28:48.270Z",
"updated": "2016-10-04T05:28:48.270Z",
"name": "Flucloxin 250mg",
"slug": "flucloxin-250mg-1-09353813995272736",
"generic": "",
"power": "",
"manufacturer": null,
"sku": "",
"price": "0.00",
"old_price": "0.00",
"is_active": true,
"unit": "piece",
"description": null,
"meta_keywords": "",
"meta_description": "",
"category": 1,
"subcategory": 1,
"height": null,
"width": null,
"image": "",
"thumbnail": "",
"dosage": 1,
"related": []
}
}]
I have tried using $.get
, $.getJSON
, etc. but the example I am following is reading from a JSON format like the following:
{
"one": "Singular sensation",
"two": "Beady little eyes",
"three": "Little birds pitch by my doorstep"
}
As you can see this is only one dict, however I am planning to read a bunch of dicts within a list. Also, please note that there is a dict within the dict under the key fields
.
How can I read the above format?