Integrating Storage

HTTP Interface

Method URL Description
GET /mdworkbench/storage/<id> Gets the contents of a storage.

Request URL Path

  • <id>: must be a valid storage identifier. Developers should not assemble a storage URL but use as-is the Content-Location information provided by the POST response.

Response Headers

  • Content-Type: the one set for the PUT and POST methods.
  • Content-Encoding: the one set for the PUT and POST methods, if any.
  • Content-Disposition: the one set for the PUT and POST methods, if any.

Response Body

The storage contents.
POST /mdworkbench/storage Creates a new storage and uploads a content. The created storage is meant to be used for a relatively short period and will expire after a certain amount of time.

Request Headers

  • Content-Type: the MIME type of the uploaded content.
  • Content-Encoding (optional): the encoding of the uploaded content.
  • Content-Disposition (optional): provides information on the uploaded file name.
  • Content-Expiration (optional): number of seconds after which the uploaded content expires. A negative number might be used to prevent expiration, in which case the storage is only deleted using an explicit DELETE request.

Request Body

The data to upload in the storage.
If the content type is multipart/form-data (data submitted by a form), the uploaded content is the one of the first file part.

Response Headers

  • Content-Location: the URL that can be used to query the storage contents (see GET) or to delete the storage (see DELETE).
PUT /mdworkbench/storage/<id> Updates the content of a storage. The storage is meant to be used for a relatively short period and will expire after a certain amount of time.

Request URL Path

  • <id>: must be a valid storage identifier. Developers should not assemble a storage URL but use as-is the Content-Location information provided by the POST response.

Request Headers

  • Content-Type: the MIME type of the uploaded content.
  • Content-Encoding (optional): the encoding of the uploaded content.
  • Content-Disposition (optional): provides information on the uploaded file name.
  • Content-Expiration (optional): number of seconds after which the uploaded content expires.

Request Body

The data to upload in the storage. If the content type is multipart/form-data (data submitted by a form), the uploaded content is the one of the first file part.
DELETE /mdworkbench/storage/<id> Deletes a storage.

Request URL Path

  • <id>: must be a valid storage identifier. Developers should not assemble a storage URL but use as-is the Content-Location information provided by the POST response.

Using the HTTP Interface

Creating a New Storage

The developer must send an HTTP POST request to the servlet URL to create a new Storage. The developer must send a HTTP Content-Type header to describe the type of uploaded data, as defined in the HTTP specification:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17

Controlling the Expiration of a Storage

The developer shall send an HTTP Content-Expiration header to determine the inactive period of time after which a Storage might be deleted. The expiration is expressed using a number of seconds. When the storage is not requested or modified after this number of seconds, the server is free to delete at any time the Storage.

The developer shall send an HTTP DELETE request to explicitly delete a Storage when it is not be used anymore, if this information can be determined.

Related concepts
Storage