I’ve looked elsewhere on SO for an answer to this question, but can’t find one.
I’m building an MVC Web API that will, in part, kick off processes on a remote machine. As of right now, a POST to “blah.com/Process” will save some initialization data to the database and instruct a windows service to begin operating on it. A GET request to “blah.com/Process/{Id}” will retrieve the current progress of the process.
These two controller actions use two different models. The POST accepts a model that contains parameter information, which the GET (since it’s used to report progress, and I couldn’t care less about the parameters) does not return. Is this a violation of RESTful design? Should I be using two different URLs, or would that be a violation of REST? As I understand it, the data being transferred should represent the current state of the process, which in my mind it does in both cases.
EDIT: Thanks for the responses. I feel more secure in my approach now. 🙂
According to Wikipedia:
Without going into complex detail, these constraints are:
Neither case in your description violates these principles. Do what makes the most sense to the consumers of the API, keeping the whole as simple as possible.