give JSON body example of relay response.

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-01-07 16:20:24 +07:00
parent 61cb6ffc6c
commit cca82d35f6

15
200.md
View File

@ -37,7 +37,7 @@ Request URL Examples:
- `https://my-relay.com/__nostr/req?kinds=0,1&limit=10` - `https://my-relay.com/__nostr/req?kinds=0,1&limit=10`
- `https://my-relay.com/__nostr/req?authors=12345,67890` - `https://my-relay.com/__nostr/req?authors=12345,67890`
To send event to relay, Client will need to make POST request to `publish` endpoint with POST body containing the JSON of the event. To send event to relay, Client will need to make POST request to `publish` endpoint with POST body containing the JSON blob of the event.
### From relay to client: sending responses and notices ### From relay to client: sending responses and notices
@ -51,3 +51,16 @@ Relay may also respond with HTTP status code:
- `200`: OK / Success - `200`: OK / Success
- `400`: Invalid Request - `400`: Invalid Request
- `500`: Relay/Server error - `500`: Relay/Server error
Response JSON body example:
```json
{
"results": [
{ "id": "...", "kind": 1, ... },
{ "id": "...", "kind": 1, ... },
...
],
"notice": ""
}
```