我在我的 python 代码中创建了请求,它给了我如下响应:
<tasks>
<task>
<description>description</description>
<name>test task 1</name>
<sysID>410d6c0bc0a801c901838d8ac43b3279</sysID>
<type>Windows</type>
<version>2</version>
</task>
<task>
<description>description</description>
<name>test task 2</name>
<sysID>410d6880c0a801c90196685fcc1ecb47</sysID>
<type>Windows</type>
<version>9</version>
</task>
</tasks>
它列出了所有任务。
但我只需要获得任务名称的列表。有没有办法在请求中指定它?还是我需要在之后解析它?
或者更一般的问题:有没有办法在请求中定义哪些标签和属性将作为响应返回?
我现在的要求:
response = req.post(uac_path, auth=HTTPBasicAuth(user, pw),
headers=headers, data=prop_params, verify=True)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句