Python在GET请求中嵌套JSON

时间:2018-09-11 12:22:07

标签: python rest python-requests

我正在尝试与ServiceDesk Plus的REST API连接。我想过滤我的查询来做到这一点,我需要在请求库的GET方法上发布嵌套的JSON。当我尝试我的代码时,我得到了未经过滤的数据,你能告诉我为什么吗?

import requests
import json
url = 'http://192.168.2.153:8080/api/v3/requests'
args = {
    "list_info": {
        "start_index": 1,
    "search_fields": {
        "subject": "Nadanie uprawnie"
    }
}
}
args_j = data_json = json.dumps(args)
header={"Content-Type": "application/json", "OPERATION_NAME": "GET_REQUEST",     "TECHNICIAN_KEY": "XXXXXXX-43CA-4ED3-860D-43D597720A32"}
response = requests.get(url,json=args,headers=header)
pr = response.text
print(pr)

0 个答案:

没有答案