July 2018
Intermediate to advanced
324 pages
8h 14m
English
This API will list all records from the PhotoAlbum model. Let's try to access the /album/ API with GET request method using the cRUL command as follows:
$ curl -i http://localhost:8000/albums/HTTP/1.1 401 UnauthorizedDate: Thu, 21 Jun 2018 07:33:07 GMTServer: WSGIServer/0.2 CPython/3.6.5Content-Type: application/jsonWWW-Authenticate: JWT realm="api"Allow: GET, POST, HEAD, OPTIONSX-Frame-Options: SAMEORIGINContent-Length: 58Vary: Cookie{"detail":"Authentication credentials were not provided."}
Here, we got a 401 Unauthorized error from, the server with the message Authentication credentials were not provided. This is how we secured all our APIs using the JWT token authentication mechanism.
Now, if we were to ...
Read now
Unlock full access