Which REST operation (GET, PUT, or POST) for validating information?

meaning-matters picture meaning-matters · Aug 13, 2013 · Viewed 16.5k times · Source

My users enter a few information fields in an iOS app. This information must be validated on my server, which has a RESTful API. After validation the UI of the iOS app changes to indicate the result.

Neither GET, PUT, or POST seem to be appropriate, because I'm not getting a resource, and neither is a resource created or updated.

What is the best fitting REST operation to implement this validation?

Answer

Lukas K picture Lukas K · Aug 13, 2013

I use the same scenario as you and use PUT for it. You have to ask yourself: "when I send the same request twice, does this make a different state on server?" If yes, use POST, if no use PUT.