- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
可能是一个简单的错误,但我通过这个简单的 Artifactory AQL POST 收到了 415 Unsupported Media Type 错误。无论是否包含内容类型 header ,我都会收到相同的错误。
#!/usr/local/bin/python
import requests
import json
username = "admin"
password = "password"
url = "http://myhost:8081/artifactory/api/search/aql"
r = requests.post(url, auth=(username, password), headers={"content-type":"application/json"}, json='{items.find( { "repo":{"$eq":"test-repo"} })}')
if r.status_code == 200:
print "Success!\n"
print r.content
else:
print "Fail\n"
print r.text
最佳答案
AQL 不是 JSON。 items.find(...)
中的文本格式为 JSON,但整个查询作为一个整体并不遵循 JSON 标准。预期的内容类型是 text/plain
。
此外,您应该使用 json='{items.find( { "repo":{"$eq":"test-repo"} })}'
而不是 data='items.find( { "repo":{"$eq":"test-repo"} })'
。
关于python-requests - 415 Artifactory AQL POST 中不支持的媒体类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52394874/
我使用的是 Artifactory 3.5。我的 Artifactory 具有自定义属性。我希望能够查询具有该属性的所有 Artifactory ,并且我希望结果显示该属性及其值。我知道我可以使用:
我想在 AQL 中返回产品选项的唯一列表,我知道 COLLECT 可以返回唯一列表,但是,我现在如何将其展平为数组。 所以我想返回以下过滤列表:(我们称之为列表[A]) [ [ "Size
给定以下文档结构: { "_key": "abc", "_id": "abc", "label": "Company ABC", "departments": [ {
我的文档是这样组织的: { "email": "tyler_li@126.com", "name": "tyler", "address": { "street": "Beijin
我遇到了一个问题,即在使用 AQL 时,我无法获得我在构建域对象上进行的任何查询以返回 当我做以下 curl 时: curl -X GET -H "X-JFrog-Art-Api: myArtifac
如何使用 Artifactory AQL 删除空文件夹(没有任何内容的文件夹)? 我有当前的 AQL 查询来查找早于 12w 且从未下载过的文件,我将通过脚本删除这些文件。 items.find(
我有一个文档集合“节点”和一个边缘集合“属性”。 我试图从“节点/582148”到“节点/582016”获取“属性”集合中的所有边。 我能够设计的最简单的 AQL 查询如下: FOR v, e, p
像 sum() 这样的聚合函数的语法到底是什么? 例如,采用以下结构: let json = { "ages": { "age": [ "20", "30",
我正在尝试弄清楚如何使用 arangodb 中的图形遍历查询来更新边缘文档。我可以使用标准来做到这一点FOR e IN collectionName UPDATE e with {newProps}
我有一个 AQL 查询遍历图,它总是应该从一组唯一的集合中返回固定数量的文档。因此每个集合只会发生一次并且只有一个文档。 我希望将它们全部合并到反射(reflect)文档集合名称的属性下的单个文档中。
我目前正尝试在 Artifactory 中查询与核心项目相关的特定 Artifactory 。所有 Artifactory 都将以项目标签为前缀。示例:“proj1-core”。我使用 Artifac
是否可以在用户定义的函数中使用标准 AQL 函数? 我试图在自定义函数中调用 IS_IN_POLYGON() 并在执行时遇到此错误: Query: AQL: in function 'GEO::IS_
我需要计算 SQL 查询结果中的元素:db._query('FOR v in visitors FILTER v.ip == "127.0.0.1" return COUNT(v.guid) ') 此
当我使用 AQL 将文档插入到集合中时,它返回一个空列表。 arangosh [test]> db._query('INSERT @document INTO vertices', {document
我想找到一组没有个人资料的用户。 ArangoDB 2.4.3 LENGTH(users) -> 130k LENGTH(profiles) -> 110k users.userId -> uniqu
我有以下 super 简单的图表: 我想做的是: 选择问题文档中名为firstQuestion 且值为true 的属性的所有问题。 选择通过 with_options 类型的出站边缘连接到问题的任何选
给出以下集合示例文档: { "timestamp": 1413543986, "message": "message", "readed": { "8": null, "9
来自 neo4j,是 Arango 的新手。 我正在尝试查询我的数据并构建相应的数据结构。 所以我有这样的东西: Circle A / \ Square A Cir
当我使用 AQL 将文档插入到集合中时,它返回一个空列表。 arangosh [test]> db._query('INSERT @document INTO vertices', {document
我有一个文档列表,想将它们合并成一个文档。Arango 的文档说您可以像这样合并两个文档: arangosh [EC]> db._query('RETURN MERGE({foo: "bar"}, {
我是一名优秀的程序员,十分优秀!