Problem:
I am trying to perform the workflow described here using http
to talk to the API:
The examples in the docs are high level HTTP commands, and I can’t figure out how to get http
to send an option value formatted as a JSON. This is what I have tried:
(pulp) [vagrant@pulp3-source-fedora35 ~]$ echo $CONFIG_STRING
[{"source_repo_version": "/pulp/api/v3/repositories/rpm/rpm/18519322-b653-4eb6-abd6-d4280b051246/versions/1/", "dest_repo": "/pulp/api/v3/repositories/rpm/rpm/e73a0382-9b09-4bfe-bb6d-8e9822580d45/"}]
(pulp) [vagrant@pulp3-source-fedora35 ~]$ http post ${BASE_ADDR}/pulp/api/v3/rpm/copy/ config="$CONFIG_STRING"
HTTP/1.1 400 Bad Request
Access-Control-Expose-Headers: Correlation-ID
Allow: POST, OPTIONS
Connection: keep-alive
Content-Length: 305
Content-Type: application/json
Correlation-ID: d7adfceb80e9496a9fa70a1c2b3fc93d
Date: Mon, 07 Feb 2022 10:49:22 GMT
Referrer-Policy: same-origin
Server: nginx/1.20.1
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
{
"non_field_errors": [
"Provided copy criteria is invalid:'['\\'[{\"source_repo_version\": \"/pulp/api/v3/repositories/rpm/rpm/18519322-b653-4eb6-abd6-d4280b051246/versions/1/\", \"dest_repo\": \"/pulp/api/v3/repositories/rpm/rpm/e73a0382-9b09-4bfe-bb6d-8e9822580d45/\"}]\\' is not of type \\'array\\'']'"
]
}
I am sure this is just some trivial http
syntax problem, but I don’t know how to solve it. Any help is appreciated.