Advertisement
bekanaveriani

SKYC tx

Dec 2nd, 2020
1,392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import os
  2. import json
  3. import requests
  4.  
  5.  
  6. url = "http://127.0.0.1:8081/transaction/import"
  7.  
  8. os.chdir(r"C:\Users\bekan\PycharmProjects\pythonProject\jsons")
  9.  
  10. jsons = os.listdir()
  11.  
  12. for js in jsons:
  13.     with open(js, encoding='utf-8') as fh:
  14.         data =json.dumps(json.load(fh), ensure_ascii=False).encode("utf8")
  15.         req = requests.post(url, data=data, headers={"content-type": "application/json"})
  16.         if (req.content):
  17.             print(req.content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement