return better data for ping api, add to readme

This commit is contained in:
simon 2022-04-01 16:20:32 +07:00
parent 3ae9fe5405
commit cae00b032b
2 changed files with 14 additions and 1 deletions

View File

@ -104,3 +104,16 @@ POST /api/download/
## Download Queue Item View ## Download Queue Item View
/api/download/\<video_id>/ /api/download/\<video_id>/
## Ping View
Validate your connection with the API
GET /api/ping
When valid returns message with user id:
```json
{
"response": "pong",
"user": 1
}
```

View File

@ -271,7 +271,7 @@ class PingView(ApiBaseView):
@staticmethod @staticmethod
def get(request): def get(request):
"""get pong""" """get pong"""
data = {"pong": request.user.id} data = {"response": "pong", "user": request.user.id}
return Response(data) return Response(data)