ruby on rails - Which HTTP method should I use for request that can create or simply read a resource? -


in rails application have url routed action in charged of showing or creating (if not existing) e resource. appropriate http verb use kind of request?

to more precise, in method don't directly access resource use library has behavior: first search , create resource if not exiting. method, in end, provide resource returned library either brand new 1 or old one. hence cannot split 2 requests.

according this , considering method returns same resource (idempotent) seems put should right one. wonder whether put can used in case e resource retrieved (get) , not updated

tnx

post creating, showing automatically used rails. hope can sorts of things custom programming data available in form of params[]


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -