Hi.
I cobbled a POST request together with help of the GeoNetwork Api
Documentation.
Great feature btw!
Request is tried out via curl:
curl -v --user admin:admin -b /tmp/cookie \
-d file=@072159d2-c075-459c-9007-41cc94b06893.mef \
-X POST
"http://localhost:8900/geonetwork/srv/api/0.1/records?metadataType=METADATA&uuidProcessing=OVERWRITE&group=gruppe&category=&rejectIfInvalid=true&publishToAll=false&assignToCatalog=true&transformWith=_none_"
\
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "X-XSRF-TOKEN: ${XSRFTOKEN}"
Response:
* About to connect() to localhost port 8900 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8900 (#0)
* Server auth using Basic with user 'bbfn'
POST
/geonetwork/srv/api/0.1/records?metadataType=METADATA&uuidProcessing=OVERWRITE&group=gruppe&category=&rejectIfInvalid=true&publishToAll=false&assignToCatalog=true&transformWith=_none_
HTTP/1.1
Authorization: Basic YmJmbjpsdmFfYmJmbg==
User-Agent: curl/7.29.0
Host: localhost:8900
Cookie: XSRF-TOKEN=652110ad-a96d-4f66-aad7-89b0677adf01
accept: application/json
Content-Type: application/json
X-XSRF-TOKEN: 652110ad-a96d-4f66-aad7-89b0677adf01
Content-Length: 45
* upload completely sent off: 45 out of 45 bytes
< HTTP/1.1 400
* Added cookie JSESSIONID="8691DDCC5103779783E04D1FFD66DE4F" for domain
localhost, path /geonetwork, expire 0
...
* Closing connection 0
{"message":"MultipartException","code":"unsatisfied_request_parameter","description":"The
current request is not a multipart request"}
Adding -H "content-type: multipart/form-data" did not maka a change.
Since MEF-Files are ZIP-Archives i expected something like -H "Content-Type:
application/zip" but that also changed nothing.
What did i wrong?
Cheers
Andy
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html