4 ms·
the idea is that instead of documenting your project list to be at /projects/ and individual projects to be at /projects/PROJECT_ID you should have a SINGLE ent
by Vitaly 17y ago
the idea is that instead of documenting your project list to be at /projects/ and individual projects to be at /projects/PROJECT_ID you should have a SINGLE entry point into your API which should have LINKS to your various services.
so you will have something like
<api>
<projects>http://../projects/</projects>
</users>http://../users</users>
</api>
or even this:
<service>
<name>projects</name>
<href>http://.../projects/</href>
</service>
...
and then your project list should not just return you projects ids to construct a url with, instead it should provide you full urls to access the relevant resources.
The rule of thumb is: with a PROPER REST API you should never do any "url generation", you should get ALL your urls (except for the SINGLE entry one) form the API.
check out this link for some more info: http://www.theamazingrando.com/blog/?p=107 http://www.theamazingrando.com/blog/?p=107