Why does Artifactory ignore the query params I provide it via REST api?

Itamar Berman-Eshel
2020-03-25 10:30

Why does Artifactory ignore the query params I provide it via REST api?

For certain REST api commands you may require to send additional parameters, these are called Query Params, which are 'key-value' pairs that appear to the right of the ? in a URL.
For example, when adding properties to a file or folder in Artifactory:
PUT /api/storage/libs-release-local/ch/qos/logback/logback-classic/0.9.9?properties=os=win,linux|qa=done&recursive=0

Any params after the initial one, i.e after 'properties=os=win' will not be handled unless the entire URL is surrounded with quotes, so in this case, the 'recursive=0' will be ignored, and since this api defaults to recursive=1, it would be apparent that the param was not handled correctly.

Resolution

In order to run this command correctly, you have to surround the entire URL with quotes:
curl -X PUT -uadmin:password "http://localhost:8081/artifactory/api/storage/libs-release-local/ch/qos/logback/logback-classic/0.9.9?properties=os=win,linux|qa=done&recursive=1"