parent
29e0857365
commit
11fda992b6
39
README.md
39
README.md
|
|
@ -8,6 +8,7 @@
|
|||
* [Installation](#installation)
|
||||
* [Configuration](#configuration)
|
||||
* [Setup Dev Environment](#setup-dev-environment)
|
||||
* [Add Message Examples](#add-message-examples)
|
||||
* [Building](#building)
|
||||
* [Tests](#tests)
|
||||
* [Versioning](#versioning)
|
||||
|
|
@ -98,6 +99,44 @@ GOTIFY_PASSSTRENGTH=10
|
|||
GOTIFY_UPLOADEDIMAGESDIR=images
|
||||
```
|
||||
|
||||
### Add Message Examples
|
||||
|
||||
You can obtain an application-token from the apps tab inside the UI or using the REST-API (`GET /application`)
|
||||
|
||||
NOTE: Assuming Gotify is running on `http://localhost:8008`.
|
||||
|
||||
**curl**
|
||||
```bash
|
||||
curl -X POST "http://localhost:8008/message?token=<token-from-application>" -F "title=My Title" -F "message=This is my message"
|
||||
```
|
||||
|
||||
**python**
|
||||
|
||||
```python
|
||||
import requests #pip install requests
|
||||
resp = requests.post('http://localhost:8008/message?token=<token-from-application>', json={
|
||||
"message": "Well hello there.",
|
||||
"priority": 2,
|
||||
"title": "This is my title"
|
||||
})
|
||||
```
|
||||
|
||||
**golang**
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.PostForm("http://localhost:8008/message?<token-from-application>", url.Values{"message": {"My Message"}, "title": {"My Title"}})
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Database
|
||||
| Dialect | Connection |
|
||||
| :-------: | :------------------------------------------------------------------: |
|
||||
|
|
|
|||
Loading…
Reference in New Issue