I have a RESTFul server API which I've built. Some parts of it is not controlling resources and I'm having trouble mapping the relevant URL + HTTP-method to the actions that are executed on the server.
e.g. I can backup every resource on the server with POST /backup
, but I'm not sure if this the most appropriate mapping. What about a single resource? Should I specify it with: POST /backup/id
or by declaring the id as a variable that I send: POST /backup <id>
Please give me some tips on how to structure this most appropriately so that my API is easy to grasp.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…