tags:

views:

42

answers:

1

Hi,

I've been O'Reilly's RESTful web services this weekend and I can't seem to find an explanation of when a client would want to kick of a business process in a server.

For example, I want to kick off administrative jobs on a given host in an enterprise, so which verb in HTTP would this fall under?

I'm thinking it would be a POST(p) (Overloaded POST) where I construct an XML request in the HTTP request body that says "Run job X for system Y with parameter Z.".

Can anyone confirm that this still conforms to REST?

Thanks, Martin

A: 

As long as you treat the job request as a resource, the result can be completely RESTful.

By POSTing to a collection of job requests you can create a jobrequest resource as a child of that collection. You would need to assign some form of identify to the job request so that you could return an URL in the Location header of the POST response. By doing a GET on that URL you can see the current status of the job request. When the job is complete, you could add a link to the job request to follow to see the results of the job.

Darrel Miller
Thanks Darrel :), I didn't consider holding the job request for addressability reasons, that's always a good thing.
Martin Blore