Created
December 20, 2022 19:46
-
-
Save itspacchu/59f73ac294bf33f6d051059e635f32ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import base64 | |
import json | |
PASSWORD = "" | |
ADD,RM = "add","rm" | |
API_URL = "https://wisun.api.prashantnook.in/update" | |
def send_update(nodeA,nodeB,contype=ADD): | |
headers = { | |
"Content-Type": "application/json" | |
} | |
data = { | |
"nodeA":nodeA, | |
"nodeB":nodeB, | |
"contype":contype, | |
"key":base64.b64encode(PASSWORD.encode('ascii')).decode('ascii') | |
} | |
return requests.post(url=API_URL,headers=headers,data=json.dumps(data)).text | |
print(send_update("WN-LP01-03","WN-LP02-02",ADD)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment