4. Repositories

Finally we can delete a repository too

As you may suspect we’re beginning to see a lot of repetition in our code. We’ll live with it for now. To delete a repository take a look at the docs. You can find it by searching for “Delete a Repository”. The curl looks like this …

    curl -H "X-ArchivesSpace-Session: $SESSION" \
        -X DELETE \
        'http://localhost:8089/repositories/:repo_id'

Notice it looks a lot like our list_repo() curl example but with an “-X DELETE”. There are four common methods in HTTP transactions

DELETE does what it sounds like. It’ll send a “DELETE” method call to the API requesting the repository to be deleted. Note deleting a record via the API is permanent. There is no “UNDO”!!!!

  1. Copy list_repo() function definition to delete_repo after update_repo
  2. We need to modify the default test methods once again