Compare commits
2 commits
dc3820d6f4
...
0990755643
Author | SHA1 | Date | |
---|---|---|---|
0990755643 | |||
d4486fc7d5 |
1 changed files with 2 additions and 0 deletions
|
@ -28,6 +28,7 @@ For example:
|
|||
The API supports pagination on all endpoints that require it, and by default the first page of 10 elements is returned. If you would like to customize the pagination, simply add the `page=` and `page_size=` paramaters to your query.
|
||||
|
||||
For example, using curl: `curl -v 'http://127.0.0.1:8000/artists?name=a&page=2&page_size=100'`
|
||||
|
||||
This would return the second page of 100 elements from the artist name search endpoint.
|
||||
Currently the genre listing endpoint also supports these parameters.
|
||||
|
||||
|
@ -35,6 +36,7 @@ Currently the genre listing endpoint also supports these parameters.
|
|||
The API endpoint to add a new genre accepts a `POST` request on the `/genres` route, and will parse several types of application input, preferring JSON and XML first but falling back to post-form parsing if the client has not specified an appropriate content type for their request.
|
||||
|
||||
To give a concrete example using JSON, the following curl request adds a new genre to the database:
|
||||
|
||||
`curl -v http://127.0.0.1:8000/genres -X POST --data '{"name": "myfancysound"}' -H "content-type: application/json"`
|
||||
|
||||
Note that since the content type is being checked by the API for parsing, you are required to specify a correct one, otherwise you must send post-form data for the API to find your values correctly.
|
||||
|
|
Loading…
Add table
Reference in a new issue