Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
526 B
4
Indexable
Never
import pandas as pd
import requests




url = 'https://backend-matem.pmc.tn/api/users/register'
headers = {'Content-Type': 'application/json'}



data = pd.read_excel('matem.xlsx')
df = pd.DataFrame(data)
json = df.to_numpy()

for i in df.itertuples():
    myobj = {'email' : i[2],'username': 'MATEM_{}'.format(i[4]) ,'password' :'123456','confirmpassword' : '123456','tiers' : 'MATEM_{}'.format(i[4]) }
    x = requests.post(url,  headers=headers, json = myobj)
    print(x.status_code)
    print(x.text)