Skip to content

Latest commit

 

History

History
86 lines (65 loc) · 1.23 KB

push.md

File metadata and controls

86 lines (65 loc) · 1.23 KB

Terry-Mao/goim push HTTP protocols

push HTTP interface protocols for pusher

Interfaces

| Name | URL | HTTP method | | :---- | :---- | :---- | | [single push](#single push) | /1/push | POST | | [multiple push](#multiple push) | /1/pushs | POST | | [room push](#room push) | /1/push/room | POST | | [broadcasting](#broadcasting) | /1/push/all | POST |

Public response body

response code description
1 success
65535 internal error

Response structure

{
    "ret": 1  //response code
}
single push
  • Example request
# uid is the user id pushing to?uid=0
curl -d "{\"test\":1}" http://127.0.0.1:7172/1/push?uid=0
  • Response
{
    "ret": 1
}
Multiple push
  • Example request
curl -d "{\"u\":[1,2,3,4,5],\"m\":{\"test\":1}}" http://127.0.0.1:7172/1/pushs
  • Response
{
    "ret": 1
}
room push
  • Example request
curl -d "{\"test\": 1}" http://127.0.0.1:7172/1/push/room?rid=1
  • Response
{
    "ret": 1
}
Broadcasting
  • Example request
curl -d "{\"test\": 1}" http://127.0.0.1:7172/1/push/all
  • Response
{
    "ret": 1
}