Fixed post url

This commit is contained in:
Lukian 2024-12-29 15:19:24 +01:00
parent b3b7a3ca2b
commit e7970f953d

View file

@ -18,8 +18,8 @@ def getShares(idComp):
- idComp : identifiant de l'entreprise - idComp : identifiant de l'entreprise
- price : prix de l'action sur le marché - price : prix de l'action sur le marché
""" """
def emmitShare(idComp, price): def emitShare(idComp, price):
url = HOST + 'api/shares/emmit' url = HOST + 'api/shares/emit'
obj={'company_id':idComp,'price':price} obj={'company_id':idComp,'price':price}
r = requests.post(url, json=obj) r = requests.post(url, json=obj)
return r.json() return r.json()
@ -46,7 +46,7 @@ if __name__ == "__main__":
for company in companies: for company in companies:
price = randint(20, 2000) price = randint(20, 2000)
for i in range(randint(0, 10)): for i in range(randint(0, 10)):
emmitShare(company["id"], price) emitShare(company["id"], price)
sleep(30) sleep(30)