Pour la première requête avec le duplicate voici le curl et les réponses associées :
curl '
http://vm-geomatique.lan.cereg.com/geonetwork/srv/api/records/duplicate?metadataType=METADATA&sourceUuid=52ca7d77-44cf-4305-a567-01bdcda9b094&group=101&hasAttachmentsOfSource=true' \
-X 'PUT' \
-H 'Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 0' \
-H 'Cookie: XSRF-TOKEN=6ca05baa-f690-47d8-9846-f40494f68bfb; JSESSIONID=node01bwz57l8txz9u1ruarpcm7ks2o36469.node0; serverTime=1745911156969; sessionExpiry=1745997556969; SESSION=83f04cfd-2bc0-44b6-b1d3-04e75aa838d4' \
-H 'Origin:
http://vm-geomatique.lan.cereg.com' \
-H 'Referer:
http://vm-geomatique.lan.cereg.com/' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
131.0.0.0 Safari/537.36' \
-H 'X-XSRF-TOKEN: 6ca05baa-f690-47d8-9846-f40494f68bfb' \
-H 'accept: application/json' \
--insecure
{"message":"Content type '' not supported","code":"runtime_exception","description":null}
HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: true
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-Requested-With, Content-Type
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 1800
Content-Security-Policy: frame-ancestors 'self'
Content-Type: application/json
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Referrer-Policy: strict-origin
Server: Caddy
Set-Cookie: serverTime=1745911192858; Path=/geonetwork
Set-Cookie: sessionExpiry=1745997592858; Path=/geonetwork
Strict-Transport-Security: max-age=631138519
Vary: Origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Xss-Protection: 0
Date: Tue, 29 Apr 2025 07:19:52 GMT
Transfer-Encoding: chunked
X-Content-Encoding-Over-Network: gzip
Si jamais, j'avais également essayé de passer la requête par script mais le problème reste le même :
Script :
#!/bin/bash
export CATALOG="
http://vm-geomatique.lan.cereg.com/geonetwork"
export CATALOGUSER="testadmin"
export CATALOGPASS="testadmin"
COOKIE_FILE="/home/admin/cookier.txt"
rm -f "$COOKIE_FILE"
curl -s -c "$COOKIE_FILE" -o /dev/null -X POST "$CATALOG/srv/eng/info?type=me"
export TOKEN=$(grep -P '\t/geonetwork\t' "$COOKIE_FILE" | grep XSRF-TOKEN | cut -f 7)
curl -v -X PUT \
-H "accept: application/json" \
-H "X-XSRF-TOKEN: $TOKEN" \
--user "$CATALOGUSER:$CATALOGPASS" \
-b "$COOKIE_FILE" \
"$CATALOG/srv/api/records/duplicate?metadataType=METADATA&sourceUuid=7043a273-6e21-4c35-8e02-fb7125c44a95&group=101&hasAttachmentsOfSource=true"
Réponse : ┌──[
ad...@vm-geomatique.lan.cereg.com] ➜ ~
└─$ bash mm.sh
* Trying 127.0.1.1:80...
* Connected to
vm-geomatique.lan.cereg.com (127.0.1.1) port 80 (#0)
* Server auth using Basic with user 'testadmin'
> PUT /geonetwork/srv/api/records/duplicate?metadataType=METADATA&sourceUuid=7043a273-6e21-4c35-8e02-fb7125c44a95&group=101&hasAttachmentsOfSource=true HTTP/1.1
> Host:
vm-geomatique.lan.cereg.com> Authorization: Basic dGVzdGFkbWluOnRlc3RhZG1pbg==
> User-Agent: curl/7.88.1
> Cookie: XSRF-TOKEN=04d139f6-f837-41ef-bc68-16ca6c89da26
> accept: application/json
> X-XSRF-TOKEN: 04d139f6-f837-41ef-bc68-16ca6c89da26
>
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Max-Age: 1800
< Content-Security-Policy: frame-ancestors 'self'
< Content-Type: application/json
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Referrer-Policy: strict-origin
< Server: Caddy
* Added cookie JSESSIONID="node01aprlwribk24210iu7bvg7ex2z39369.node0" for domain
vm-geomatique.lan.cereg.com, path /geonetwork, expire 0
< Set-Cookie: JSESSIONID=node01aprlwribk24210iu7bvg7ex2z39369.node0; Path=/geonetwork; HttpOnly
* Added cookie serverTime="1745911506597" for domain
vm-geomatique.lan.cereg.com, path /geonetwork, expire 0
< Set-Cookie: serverTime=1745911506597; Path=/geonetwork
* Added cookie sessionExpiry="1745911506597" for domain
vm-geomatique.lan.cereg.com, path /geonetwork, expire 0
< Set-Cookie: sessionExpiry=1745911506597; Path=/geonetwork
< Strict-Transport-Security: max-age=631138519
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Xss-Protection: 0
< Date: Tue, 29 Apr 2025 07:25:06 GMT
< Transfer-Encoding: chunked
<
* Connection #0 to host
vm-geomatique.lan.cereg.com left intact
{"message":"Content type '' not supported","code":"runtime_exception","description":null}┌──[
ad...@vm-geomatique.lan.cereg.com] ➜ ~
└─$
Et pour le POST records voici le curl et les réponses :
curl '
http://vm-geomatique.lan.cereg.com/geonetwork/srv/api/records?metadataType=METADATA&uuidProcessing=GENERATEUUID&assignToCatalog=true&transformWith=_none_' \
-X 'POST' \
-H 'Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 0' \
-H 'Cookie: XSRF-TOKEN=6ca05baa-f690-47d8-9846-f40494f68bfb; JSESSIONID=node01bwz57l8txz9u1ruarpcm7ks2o36469.node0; serverTime=1745912040923; sessionExpiry=1745998440923; SESSION=83f04cfd-2bc0-44b6-b1d3-04e75aa838d4' \
-H 'Origin:
http://vm-geomatique.lan.cereg.com' \
-H 'Referer:
http://vm-geomatique.lan.cereg.com/' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
131.0.0.0 Safari/537.36' \
-H 'X-XSRF-TOKEN: 6ca05baa-f690-47d8-9846-f40494f68bfb' \
-H 'accept: application/json' \
--insecure
{"message":"A file MUST be provided.","code":"unsatisfied_request_parameter","description":null}
HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: true
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-Requested-With, Content-Type
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 1800
Content-Security-Policy: frame-ancestors 'self'
Content-Type: application/json
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Referrer-Policy: strict-origin
Server: Caddy
Set-Cookie: serverTime=1745912090153; Path=/geonetwork
Set-Cookie: sessionExpiry=1745998490153; Path=/geonetwork
Strict-Transport-Security: max-age=631138519
Vary: Origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Xss-Protection: 0
Date: Tue, 29 Apr 2025 07:34:50 GMT
Transfer-Encoding: chunked
X-Content-Encoding-Over-Network: gzip