-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestrun.py
More file actions
28 lines (25 loc) · 1.03 KB
/
Copy pathtestrun.py
File metadata and controls
28 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import requests
url = 'http://localhost:5000/input'
payload = {'client': 'Fred', 'data': 'I will buy all the doge coins in this world today'}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.content)
print("")
# Send a GET request to read the blockchain
response = requests.get('http://localhost:5000/blocks')
print(response.content) # Print the response in JSON format
print("")
print("")
url = 'http://localhost:5000/input'
payload = {'client': 'Fred', 'data': 'doge coin is losing money now! sell all!'}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.content)
print("")
# Send a GET request to read the blockchain
response = requests.get('http://localhost:5000/blocks')
print(response.content) # Print the response in JSON format
print("")
# Send a GET request to read the blockchain
response = requests.get('http://localhost:5000/blocks')
print(response.content) # Print the response in JSON format