sideshowcoder / canned

Server to respond with fake API responses, by using a directory of files for finding out what to say!
213 stars 46 forks source link

Ability to give different responses for a same polling request #106

Closed swapnasavant closed 8 years ago

swapnasavant commented 8 years ago

I have a RestAPI which I poll from UI to get status of an operation. The API returns inprogress/success/failure for the same request. I need to mock this API to first show inprogress and then succeeded.

Is there any way I can do this with canned?

sideshowcoder commented 8 years ago

Sorry for the late response, this is currently not possible directly as canned maps to files, however in case your api sends different parameters this can be accomplished through the use of multiple responses (in one file) matching the request parameters.