Created
March 14, 2019 08:01
-
-
Save farzadhallaji/f1fd59a2f98f4adde61f67b5eaac1a61 to your computer and use it in GitHub Desktop.
sawtooth request
This file contains 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 json | |
auth_token = "eyJhbGciOiJIUzUxMiIsImlhdCI6MTU1MjM3MTg3OCwiZXhwIjoxNTUyMzc1NDc4fQ.eyJlbWFpbCI6Im1vaGFtYWQuYWRrNzhAZ21haWwuY29tIiwicHVibGljX2tleSI6IjAyNzk0NGYwOWY3ZDNiYzk2NTkyNWFhZDBmMDdjNDkxZDY4MmU2YjgxOWNlZTY1Yjg5MzY2NzA4NDJjNDIzY2FmMyJ9.vioLHca_WRfq1QK51lxb_WGEOcSxuq9BPkyyz233vM_mVMBptEHOuwui2l9PeCjw86BBFwXzUmvshhn5_bBlZw" | |
urlP = 'http://212.24.96.236:8040/' | |
def signup(email,passw,label,des) : | |
headers = {'Content-type': 'application/json', 'Accept': 'text/plain' , 'Authorization': 'Bearer ' + auth_token} | |
path = "accounts" | |
payload = { 'label' : label | |
, 'description' : des | |
, 'email' : email | |
, 'password' : passw | |
} | |
# 'label', 'description', 'email', 'password' | |
r = requests.post(urlP + path, data=json.dumps(payload), headers=headers) | |
parsed = json.loads(r.text) | |
print(str(json.dumps(parsed, indent=4, sort_keys=True))) | |
return parsed | |
def login (email,passw) : | |
return token | |
def create_offer() : | |
return id? | |
def accept_offer() : | |
return description? | |
def create_request() : | |
return description? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment