我有以下代码
from requests import session
payload = {
'action': 'login',
'id': 'xxxxxxx',
'password': 'xxxxxxx'
}
with session() as c:
c.post('https://www.yalehomesystem.co.uk/homeportal/api/login/check_login', data=payload)
response = c.get('https://www.yalehomesystem.co.uk/homeportal/api/panel/get_panel_mode')
print(response.text)
返回以下响应
{"result":"1","message":[{"area":"1","mode":"disarm"}],"code":""}
我如何只返回模式? (这是“撤防”)
欢呼
答案 0 :(得分:1)
使用var onSelectMainGrid : function(grid, selectedItem) {
. . .
}
模块中的json.loads()
函数将字符串解析为字典,然后根据需要进行索引:
var dependentGridStore = Ext.create('Ext.data.Store', {
model: 'OperationDependent',
pageSize: 10,
proxy: {
type: 'jsonp',
noCache: false,
extraParams: { // <==THIS IS NEW
valueFromMainGrid: '{selectedValueFromMainGrid}'
}
api: {
create: urlRoot + 'Create',
read: urlRoot + 'Read',
update: urlRoot + 'Update',
destroy: urlRoot + 'Destroy'
},
reader: {
type: 'json',
. . .
. . .
});