Skip to content

Instantly share code, notes, and snippets.

@nainglinaung
Created August 13, 2021 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nainglinaung/500f8ff21b4fc67786a7905131e70228 to your computer and use it in GitHub Desktop.
Save nainglinaung/500f8ff21b4fc67786a7905131e70228 to your computer and use it in GitHub Desktop.
for testing
import requests
import json
url = "http://139.59.234.141:6000/beacon"
payload = json.dumps({
"timestamp": 1628151498,
"datetime": "05-Aug-2021 15:18:18",
"riderdome_device_id": "1423219059433",
"ride_id": 3,
"event_type": "alert",
"gps": {
"lat": 1.297386,
"long": 103.785866,
"speed_kmh": 0
},
"app_status": 1,
"alert_data": {
"id": 4,
"class": 0,
"distance_m": 0,
"screenshot": ""
}
})
headers = {
'Content-Type': 'application/json',
'Cookie': 'jwt=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwYzZkOGI4ZTA5ZDVmZDkyMTYwMjI2YSIsImlhdCI6MTYyODc0MTY1NiwiZXhwIjoxNjI5NjA1NjU2fQ.Ho5Ymkc2qzDEx374kTjDCRKQyKgEglnRGmrR12nXclVNQJXOexcZV-Q2kcTuyqcHeOLmEzyPKzcHsX62LlopD_0LeGDGLIhmci4S1r2t22OFy4fAcpDimTUyw_6LVDfFi-9P_8zWrcBKasZvu5TKRnDAXm79AJhjU0hD02YxULsN4N2u_61JIVN69fr_S4S9PnkBXRDAWs3wS1ZsxnhkBe5araYXUlO9GSkqgmW4l8iaDlmTxVZ5Zo8vOIKRpXVXhK5C1xPMqzRXPeghxpvIzfKgQH7TF-pEKap1q24Q-tH06iR1g0WPkAw9BJF6sSa7N0_pRDNsgEO7lQzFr7J3G-vb1YM9lOfeQwM_zA3vQhBFun3tXyTAwQ82mpH2v51VoxomdT3kpBUqAyyRt0FcwxKI7dIw_00C4rekWJQl2qAG256Ce1pz4JuAu4DgF2w2YyM92ngPC9CsIMyK3IiLUSFwS0Kr6EGc32ESviIfmp1BNKIDvZjNajOrd1pExeT45zkGxR3OWTXUKr4MrNBvUfeer2p6JfARHQLPtYxxL18Ijqn-gUSAvTliQCC2YxY1-tRl5K_zkEv_9hBCAbxMHIAP3J03NGFbAY426kAb_NPXdcw5H7Z_IxAnHkZq6ZkrkRmHQ2Cr5Z3KhtAu8EcuNgrJbzji5r84LJ9CRPI9jXw'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment