c# - Restsharp JSON 响应搜索
问题描述
我需要搜索以下 JSON 响应。我无法控制 JSON 如何返回给我或它是如何嵌套的。我默认使用 Restsharp,但我愿意接受任何可以帮助我完成任务的方法。
{
"response": [
{
"id": 1008,
"brandId": 74,
"collectionId": 32,
"productTypeId": 1,
"nominalCodeStock": "1200",
"nominalCodePurchases": "5002",
"nominalCodeSales": "4000",
"seasonIds": [
],
"identity": {
"sku": "SKU0001",
"isbn": "0684843285",
"ean": "ISNB09712345",
"upc": "5778400001",
"barcode": "738737638"
},
"productGroupId": 0,
"featured": false,
"stock": {
"stockTracked": true,
"weight": {
"magnitude": 0.7
},
"dimensions": {
"length": 2,
"height": 12,
"width": 5,
"volume": 120
}
},
"financialDetails": {
"taxCode": {
"id": 7,
"code": "T20"
}
},
"salesChannels": [
{
"salesChannelName": "Brightpearl",
"productName": "Product B",
"productCondition": "new",
"categories": [
{
"categoryCode": "276"
},
{
"categoryCode": "295"
}
],
"description": {
"languageCode": "en",
"text": "Some description",
"format": "HTML_FRAGMENT"
},
"shortDescription": {
"languageCode": "en",
"text": "Some short description",
"format": "HTML_FRAGMENT"
}
}
],
"composition": {
"bundle": false
},
"variations": [
{
"optionId": 1,
"optionName": "Colour",
"optionValueId": 1,
"optionValue": "Black"
},
{
"optionId": 3,
"optionName": "Colour",
"optionValueId": 9,
"optionValue": "Black"
}
],
"warehouses": {
"2": {
"defaultLocationId": 5,
"reorderLevel": 1,
"reorderQuantity": 0
},
"3": {
"defaultLocationId": 0,
"reorderLevel": 1,
"reorderQuantity": 1
}
},
"createdOn": "2015-01-08T17:57:18.000Z",
"updatedOn": "2015-04-01T13:17:58.000Z",
"reporting": {
"categoryId": 353,
"subcategoryId": 369,
"seasonId": 2
},
"primarySupplierId": 202,
"status": "LIVE",
"salesPopupMessage": "Offer the extended warranty",
"version": 1192098806000
}
]
}
具体来说,我需要检索 categoryCode 值。我迷路了。任何方向都非常感谢。
解决方案
推荐阅读
- python - 将滚动窗口添加到熊猫中每一行的列
- javascript - 如何以递归方式编写我的函数?
- character - 占字符搜索之间的空间
- c++ - 对文件中的数字进行冒泡排序,以降序排列第一个数字
- python-xarray - 如何使用xarray选择和总结从开始到结束时间戳的特定时间?
- python - 找不到模块 pyfiglet
- c++ - 在 C++ 中有没有办法像在 python 中那样按名称传递参数?
- javascript - 按空格分割,保留大括号但包含空格
- wildfly - Wildfly 上的 Skyve 不会因 StateTransitionException 而重新启动
- d3.js - 使用 D3.js 从同一附加实例中的不同级别的嵌套对象访问值