Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit a974ca7

Browse files
committed
Merge pull request #14 from arnuschky/feature-doc-authformats
Clarified auth token request content type
2 parents ecc774f + b19f0b7 commit a974ca7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ You can easily test if the endpoint is working by doing the following in your te
4949
$ curl -X POST -d "username=admin&password=abc123" http://localhost:8000/api-token-auth/
5050
```
5151

52+
Alternatively, you can use all the content types supported by the Django REST framework to obtain the auth token. For example:
53+
54+
```bash
55+
$ curl -X POST -H "Content-Type: application/json" -d '{"username":"admin","password":"abc123"}' http://localhost:8000/api-token-auth/
56+
```
57+
5258
Now in order to access protected api urls you must include the `Authorization: JWT <your_token>` header.
5359

5460
```bash

0 commit comments

Comments
 (0)