The HTTP protocol has built-in support for the concept of background or batch operations in the form of status code 202:
10.2.3 202 Accepted
The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent's connection to the server persist until the process is completed. The entity returned with this response SHOULD include an indication of the request's current status and either a pointer to a status monitor or some estimate of when the user can expect the request to be fulfilled.
Clients will appreciate if your 202 response also includes a Location
header where they may check the status. This is especially important for any automated end-to-end tests.
I'm not sure if this is really your question, because a large chunk of it actually seems to be referring to Content Negotiation, which is how you store or retrieve "different representations" of something. Of course you can just have different URLs, such as /widgets/1/info
and widgets/1/blob
, but the preferred way of doing this is through conneg. There are two headers that are relevant here:
Accept
, which specifies what the client wants to receive;
Content-Type
, which specifies what the client is actually sending.
So, for example, let's say you have a widgets
API that is supposed to be able to support widgets in either the "ACME" or "OMNI" format. The client can send in either format via the Content-Type
header:
The server should understand both of these requests and choose the correct parsing method based on the Content-Type
header. On the receiving end, the client specifies with Accept
:
Both requests are for the same resource, and they use the same method (GET), but when the server sees the first one, it should provide the data using the ACME scheme, and when it sees the second one, it should provide the same data in OMNI scheme.
One considerable benefit of this approach is that every resource still has a canonical URI which you can use in Location
headers and so on. It's not required, but generally ideal in REST for each resource to "live" at exactly one URI and no more.
If the difference is truly between data and metadata then you probably should have an actual metadata resource, like /widgets/123/info
, but if you are dealing with different representations of the same data then you should use Accept
and Content-Type
.
I think that covers all aspects of your question, but if you think something is missing - please clarify.