" 405不允许的方法"用于Artifactory API调用

时间:2017-05-04 16:31:28

标签: artifactory

我试图找到在Artifactory上14938720001493872435之间创建的所有项目,但我得到了405。

$ curl -X POST -H "X-JFrog-Art-Api: <KEY>" "http://localhost:8081/artifactory/api/search/creation?from=1493872000&to=1493872435&repos=project1"

{
  "errors" : [ {
    "status" : 405,
    "message" : "Method Not Allowed"
  } ]
}

我的命令有问题吗?我正在使用文档here

并非所有API调用似乎都适合我,但curl -H "X-JFrog-Art-Api: <KEY>" -X PUT "http://localhost:8081/artifactory/project1/artifacts.zip" -T artifacts.zip(上传工件)确实有效。

1 个答案:

答案 0 :(得分:1)

使用GET,而不是POST:

curl -X GET -H "X-JFrog-Art-Api: <KEY>" "http://localhost:8081/artifactory/api/search/creation?from=1493872000&to=1493872435&repos=project1"