【发布时间】:2016-03-25 18:03:24
【问题描述】:
我正在尝试将人工查询作为主体发送到 POST 方法。我总是得到 400 的响应(这是一个错误的请求)。这是我的代码。我在这里做错了什么。查询看起来不错它可以使用 curl 和 Groovy。
host = http://artifactory.com/artifactory
build_url = '%s/api/search/aql' % (host)
payload='{items.find({"repo":"lib","type":"file","path":"builds"}).include("*"}'
response = requests.post(build_url,data=payload,auth=(user:pwd))
print response
输出: 响应 [400]
我使用的是 Python 2.7,这里是 REST API 详细信息
Artifactory Query Language (AQL) REST API
Since: 3.5.0
Security: Requires an authenticated user
Usage: POST /api/search/aql
Consumes: text/plain
--提前致谢
【问题讨论】:
标签: python python-2.7 python-requests artifactory