Merge pull request #30 from gazconroy/main

Added links to summary and inserted links to WebSocket API
This commit is contained in:
Dessalines 2021-02-27 17:57:08 -05:00 committed by GitHub
commit 3cf0b45c6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -21,6 +21,8 @@
- [Docker Development](contributing/docker_development.md) - [Docker Development](contributing/docker_development.md)
- [Local Development](contributing/local_development.md) - [Local Development](contributing/local_development.md)
- [Theming Guide](contributing/theming.md) - [Theming Guide](contributing/theming.md)
- [API reference](contributing/api_reference.md)
- [WebSocket API](https://join.lemmy.ml/api/index.html)
- [HTTP API](contributing/http_api.md) - [HTTP API](contributing/http_api.md)
- [Creating a Custom Frontend](contributing/custom_frontend.md) - [Creating a Custom Frontend](contributing/custom_frontend.md)
- [Tests](contributing/tests.md) - [Tests](contributing/tests.md)

View file

@ -20,14 +20,14 @@
## WebSocket vs HTTP API ## WebSocket vs HTTP API
Lemmy's HTTP API is almost identical to its WebSocket API: Lemmy's HTTP API is almost identical to its WebSocket API:
- **WebSocket API** needs `let send = { op: userOperation[op], data: form}` as shown in [the WebSocketAPI specification](add_link) - **WebSocket API** needs `let send = { op: userOperation[op], data: form}` as shown in [the WebSocketAPI specification](https://join.lemmy.ml/api/index.html)
- **HTTP API** needs the form (data) at the top level, an HTTP operation (GET, PUT or POST) and endpoint (at `http(s)://host/api/v2/endpoint`). For example: - **HTTP API** needs the form (data) at the top level, an HTTP operation (GET, PUT or POST) and endpoint (at `http(s)://host/api/v2/endpoint`). For example:
> `POST {username_or_email: X, password: X}` > `POST {username_or_email: X, password: X}`
For more information, see the [http.ts](https://github.com/LemmyNet/lemmy-js-client/blob/main/src/http.ts) file. For more information, see the [http.ts](https://github.com/LemmyNet/lemmy-js-client/blob/main/src/http.ts) file.
[The WebSocket API](Add_link) should be regarded as the primary source for the HTTP API since it also provides information about how to form HTTP API calls. [The WebSocket API](https://join.lemmy.ml/api/index.html) should be regarded as the primary source for the HTTP API since it also provides information about how to form HTTP API calls.
## Examples ## Examples