Handling requests RESTfully?
https://softwareengineering.stackexchange.com/questions/103443
-
02-11-2019 - |
質問
There is a push in modern scripting frameworks to use RESTful request routing instead of a one-size-fits-all URL path routing.
respond('GET', '/posts', callback);
respond('POST', '/post/create', callback);
respond('PUT', '/post/[i:id]', callback);
respond('DELETE', '/post/[i:id]', callback);
vs
respond('/posts', callback);
respond('/post/create', callback);
respond('/post/[i:id]', callback);
respond('/post/[i:id]', callback);
I must confess that I am still using the old-and-busted method where the resource is accessible at the given URL regardless of the request type.
Is there anything I'm missing by using the old format?
正しい解決策はありません
所属していません softwareengineering.stackexchange