Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import json
- import requests
- url = "http://127.0.0.1:8081/transaction/import"
- os.chdir(r"C:\Users\bekan\PycharmProjects\pythonProject\jsons")
- jsons = os.listdir()
- for js in jsons:
- with open(js, encoding='utf-8') as fh:
- data =json.dumps(json.load(fh), ensure_ascii=False).encode("utf8")
- req = requests.post(url, data=data, headers={"content-type": "application/json"})
- if (req.content):
- print(req.content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement