https://github.com/blakeliafk/httpshared
https://github.com/blakeliafk/httpshared
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/blakeliafk/httpshared
- Owner: BlakeLiAFK
- Created: 2018-08-14T08:11:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-17T11:25:48.000Z (over 7 years ago)
- Last Synced: 2025-02-07T08:23:30.875Z (11 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTPShared
[](https://travis-ci.org/DGHeroin/HTTPShared)
[](https://codecov.io/gh/DGHeroin/HTTPShared)
### 写入
写入一个值, 键为message 值为hello (["message"] = "hello"), 需要用 HTTP PUT 操作
```
curl http://127.0.0.1:9999/v1/keys/message -X PUT -d hello
```
### 读取
读取key为message的值
```
curl http://127.0.0.1:9999/v1/keys/message
```
### 监听值的变化
监听一次变化
```
curl http://127.0.0.1:9999/v1/keys/message?wait=true
```
一直监听变化
```
curl http://127.0.0.1:9999/v1/keys/message?wait=true&r=true
```
一直监听变化(每次返回json之前, 先写入4个字节int数据用来标识接下来json的长度)
```
curl http://127.0.0.1:9999/v1/keys/message?wait=true&r=true&h=true
```