swh.deposit.api.sword_edit module#

class swh.deposit.api.sword_edit.SwordEditAPI[source]#

Bases: APIPost

Deposit request class defining api endpoints for sword deposit.

What’s known as ‘SE-IRI’ in the sword specification.

HTTP verbs supported: POST

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

parser_classes = (<class 'swh.deposit.parsers.SWHMultiPartParser'>, <class 'swh.deposit.parsers.SWHAtomEntryParser'>)#
process_post(request, headers: ParsedRequestHeaders, collection_name: str, deposit: Deposit | None = None) Tuple[int, str, Receipt][source]#

Add new metadata/archive to existing deposit.

This allows the following scenarios to occur:


In optimal case for a multipart and atom-entry update, a 201 Created response. The body response will hold a deposit. And the response headers will contain an entry ‘Location’ with the EM-IRI.

For the empty post case, this returns a 200.