5834Re: [rest-discuss] RESTful representation of side effects?
- Apr 5, 2006Hi Ernie,
> I want to provide a web service that, say, converts HTML documentsThat is confusing. Why "document=mydocument.html"? Is the server
> into various formats. The naive RPC method would seem to be to
> create a special URL string for each type, e.g.:
translating the input file or is it getting the file from somewhere
else? I could understand a gateway form like
OTOH, a translation service like
can simply be a POST of file-upload with the response being the
> However, that doesn't seem very RESTful.Why? POST is RESTful too, when it is used correctly.
> I would imagine the RESTfulThat would only make sense if you want the document to be stored
> alternative would be to:
> a) PUT the initial resource; get a URL back
> b) <do something to that URL>
> c) Return the URL describing that resource
> d) GET the final resource
> But, if so, I can't figure out the RESTful way to do (b). Is there?
as a new resource that is available from then on, and the converted
forms are available via different links and/or negotiation.
In that case, you want the Alternates header field, though similar
functionality can be accomplished within the body of a 201 response.
It is relatively easy to create an HTTP server module that
provides content-conversion on the fly for anything stored within
the system. It then becomes a resource discovery problem (how does
the client know where to obtain all of these other formats?), which
is what Alternates or Link was intended to supply.
- << Previous post in topic Next post in topic >>