Add trailing slashes to URLs

This commit is contained in:
Tanner Collin 2018-09-14 17:39:06 -06:00
parent 3ae25304c2
commit cfe6677e3d

View File

@ -15,11 +15,11 @@ $ . env/bin/activate
## API ## API
The API is RESTful and returns hyperlinked json data. The API is RESTful and returns hyperlinked json data. URLs require a trailing slash.
### For anonymous users ### For anonymous users
#### GET `/tooldata` #### GET `/tooldata/`
Returns all the info about the shop and its tools. Tools are split into categories. Returns all the info about the shop and its tools. Tools are split into categories.
@ -79,7 +79,7 @@ Example response:
### For authenticated users ### For authenticated users
#### GET `/user` #### GET `/user/`
Returns info about the logged in user, including which tools they are authorized on. Note the top-level array (a quirk of django-rest-framework). Returns info about the logged in user, including which tools they are authorized on. Note the top-level array (a quirk of django-rest-framework).
@ -106,29 +106,29 @@ Example response:
Ensure images are square and 1280x1280 px large. Slugs should be lowercase and one word (replace spaces with hyphens). Ensure images are square and 1280x1280 px large. Slugs should be lowercase and one word (replace spaces with hyphens).
#### GET, POST `/tool` #### GET, POST `/tool/`
Get a list of tools, or post a new tool to the database. Get a list of tools, or post a new tool to the database.
#### GET, PUT, DELETE `/tool/[slug]` #### GET, PUT, DELETE `/tool/[slug]/`
Get a specific tool, modify or delete an existing one. Get a specific tool, modify or delete an existing one.
#### GET, POST `/category` #### GET, POST `/category/`
Get a list of categories, or post a new category to the database. Get a list of categories, or post a new category to the database.
#### GET, PUT, DELETE `/category/[slug]` #### GET, PUT, DELETE `/category/[slug]/`
Get a specific category, modify or delete an existing one. Get a specific category, modify or delete an existing one.
Note: you can only delete a category that has no tools. Note: you can only delete a category that has no tools.
#### GET `/profile` #### GET `/profile/`
Get a list of all profiles. Get a list of all profiles.
#### GET, PUT `/profile/[id]` #### GET, PUT `/profile/[id]/`
Get a specific profile, or modify an existing one. Get a specific profile, or modify an existing one.