Update README with info about the two new subtitle endpoints.
This commit is contained in:
12
README.md
12
README.md
@@ -42,10 +42,18 @@ To connect to the WebSocket for receiving subtitles and messages, simply use the
|
||||
websocat ws://localhost:8000/ws
|
||||
`
|
||||
|
||||
To push new subtitles onto the server, use the `/subtitles` endpoint, for example like this:
|
||||
To push new subtitles onto the server, use the `/subtitles` endpoints. There are currently two different ones, and each produces different response type. Here are some examples:
|
||||
|
||||
- The first is `/subtitles/update_current`, which serves the purpose of updating the current sentence as it comes. Here is an example:
|
||||
|
||||
`
|
||||
curl -X POST http://localhost:8000/subtitles -H "Content-Type: text/plain" -d 'I love pushing subtitles to servers!'
|
||||
curl -X POST http://localhost:8000/subtitles/update_current -H "Content-Type: text/plain" -d 'I love pushing '
|
||||
`
|
||||
|
||||
- The second is `/subtitles/submit_sentence`, which is used to submit the next finished sentence. Here is an example:
|
||||
|
||||
`
|
||||
curl -X POST http://localhost:8000/subtitles/submit_sentence -H "Content-Type: text/plain" -d 'I love pushing sentences to servers!'
|
||||
`
|
||||
|
||||
To control the server using commands, use the `/control` endpoint, for example like this:
|
||||
|
Reference in New Issue
Block a user