Abstract
Provides a mechanism for POST'ing updates to member resources. PUT would be used to replace the member representation (e.g. if I wanted to replace the binary representation of a JPEG). POST would be used to update metadata associated with the member representation (e.g. if I wanted to change the atom:title and atom:summary associated with the JPEG). The representation format to use with the POST is up to the server. It's up to the server to figure out the specific action(s) to be taken in response to the POST. The Title HTTP Header could still be used on the initial POST of the media resource, but it would not be required.
This references PaceReworkProtocolModel but does not depend on it)
Example:
Create the resource PO ST /collection-uri HT TP/1.1 Host: example.org Content- Type: image/png Content- Length: nnnn {binary-data} Create response HT TP/1.1 200 OK Date: .... Content- Length: nnnn Content- Type: application/atom+xml Location: http://example.org/files/img.png <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom"> <id>urn:myimage</id> <title>img.png</title> <summary>img.png</summary> <updated>...</updated> <link rel="edit" href="http://example.org/files/img.png" /> <content type="image/png" src="http://example.org/public/img.png" /> </entry> Update metadata for the entry. It's up to the server implementation to figure out how to process this. POST /files/img.png HTTP/1.1 Host: example.org Content- Type: application/atom+xml Content- Length: nnnn <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom"> <id>urn:myimage</id> <title>My Trip to the Beach</title> <summary>This is a picture of my trip to the beach</summary> <updated>...</updated> <link rel="edit" href="http://example.org/files/img.png" /> <content type="image/png" src="http://example.org/public/img.png" /> </entry>
Status
Proposed
Rationale
The -06 draft provides no mechanism for updating the metadata for media resources (e.g. changing the atom:title and atom:summary for a post'ed PNG resource). A POST against the resource URI provides a workable solution.
Proposal
(add to Protocol Operations Section)
#.# Appending metadata to a resource Client Server | | | 1) POST to Member Resource IRI | |------------------------------->| | | | 2) 200 OK | |<-------------------------------| | | 1. The client POSTs a representation of the metadata to append to the IRI of the member resource 2. Upon successful processing of the append operation, the server responds with a status code of either a 200 ("OK") or 204 ("No Content").
Assuming Pace Rework Protocol Model is accepted, add the following into the "Protocol Model" section
Clients may append or modify metadata associated with a member resource by sending an HT TP POST request to the IRI of the resource.