0

I need your help. I would like to access my Archiva artefact repository using the REST api, but only one request works: http://myArchiva/restServices

It returns a list of URLs to access the wadl files. But the listed urls as well as all other requests described in the Archiva documentation return status 404 - Not found! I tried it with Archiva 2.2.3 (with or without CRSF activated) and also with Archiva 2.2.1.

What do I wrong? Do I need to add special headers?

bkrgr1
  • 23
  • 5

1 Answers1

1

me found out 2 things that has to be done to work with Archiva REST-API (tested with archiva v2.2.3):

Example URL Base Pattern for Rest-Requests:
http://[YOUR-ARCHIVA-BASE-URL]/restServices/archivaServices/
(from that point you can target the URL's as described in the Archiva-REST-Docs)

It seems to be required that u have to put in Header a Referer in that manner:
Referer: http://[YOUR-ARCHIVA-BASE-URL]/

This finally works for me.

Robin
  • 28
  • 3
  • You have to add the Origin header field as well now. See http://archiva.apache.org/redback/integration/rest.html – gamma May 08 '18 at 12:25
  • With archiva 2.2.5: I used `wget --http-user=myuser --http-password='pwd' --referer=http://mysite:8080 http://mysite:8080/restServices/archivaServices/pingService/ping` and it worked just fine – Serge Chastel Mar 17 '21 at 22:04