-
Notifications
You must be signed in to change notification settings - Fork 51
Home
Welcome to the KopoBlockchain wiki!
Under Construction...
import http.client
conn = http.client.HTTPConnection("localhost:8099")
headers = { 'content-type': "application/json", }
conn.request("GET", "/block/getBlockData", headers=headers)
res = conn.getresponse() data = res.read()
print(data.decode("utf-8"))
import http.client
conn = http.client.HTTPConnection("localhost:8099")
headers = { 'cache-control': "no-cache", }
conn.request("GET", "/block/generateBlock", headers=headers)
res = conn.getresponse() data = res.read()
print(data.decode("utf-8"))
import http.client
conn = http.client.HTTPConnection("localhost:8099")
payload = "[\n {\n "sender": "TemperatureSensor",\n "amount": "26",\n "receiver": "AirConditioner"\n },\n {\n "sender": "TemperatureSensor",\n "amount": "1016",\n "receiver": "MainController"\n }\n]"
headers = { 'content-type': "application/json;charset=utf-8", 'cache-control': "no-cache", }
conn.request("POST", "/block/newtx", payload, headers)
res = conn.getresponse() data = res.read()
print(data.decode("utf-8"))