REST API Design Guideline
21:15 16 Apr 2013

I am in the process of designing a public API for our REST interface. One of the thing's that came up was the use of the http verbs, specifically the DELETE verb.

We want to expose methods to start/stop or execute/abort a particular job. The two flavors of api design for these two are:

POST

http://localhost/api/campaignrun/1

Execute campaign run with an id of 1

DELETE

http://localhost/api/campaignrun/1

Abort the campaign run with an id of 1

Alternatively...

POST

http://localhost/api/campaignrun/1

{ action=execute}

Execute campaign run with an id of 1

POST

http://localhost/api/campaignrun/1

{ action=abort }

Abort campaign run with an id of 1

If have my favorite, which one is more RESTful?

rest api-design