Skip to content

Updating vs replacing molecules via the HTTP API #51

@MaybeJustJames

Description

@MaybeJustJames

Currently there is POST /api/v1/metabolites/new. The HTTP RFC defines the POST method like so:

The POST method is used to request that the origin server accept the
entity enclosed in the request as a new subordinate of the resource
identified by the Request-URI in the Request-Line. POST is designed
to allow a uniform method to cover the following functions:

 - Annotation of existing resources;

 - Posting a message to a bulletin board, newsgroup, mailing list,
   or similar group of articles;

 - Providing a block of data, such as the result of submitting a
   form, to a data-handling process;

 - Extending a database through an append operation.

And the PUT method like so:

The PUT method requests that the enclosed entity be stored under the
supplied Request-URI. If the Request-URI refers to an already
existing resource, the enclosed entity SHOULD be considered as a
modified version of the one residing on the origin server. If the
Request-URI does not point to an existing resource, and that URI is
capable of being defined as a new resource by the requesting user
agent, the origin server can create the resource with that URI. [...]

Therefore the metabolite submission API should be something like, PUT /api/v1/metabolite/ALPHA-GLUCOSE and should create if it doesn't exist, or update if it does exist. There should also be a version field and a submission date field in the database.

Metadata

Metadata

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions