Commit d1a1caa0 authored by Vincent-Xavier JUMEL's avatar Vincent-Xavier JUMEL
Browse files

Ajout de la charge utile

parent 4468fd28
Pipeline #339063 failed with stages
in 1 minute and 4 seconds
......@@ -52,12 +52,16 @@ def put_seance(token, date, classe, contenu):
def attach_document(token, document, context):
idContexte = json.loads(context.text)["data"]['idCDT']
with open(document,'r') as f:
data = f.read()
boundary='---------------------------23681658131424797482946919298'
headers = {'Content-Type': 'multipart§/form-data; boundary={boundary}'}
data_binary = f"""{boundary}\r\n
Content-Disposition: form-data; name="data"\r\n\r\n{{'token':'{token}','idContexte':'{idContexte}','side':'seance'}}\r\n
Content-Disposition: form-data; name="file"; filename="{document}"\r\n
Content-Type: text/x-tex\r\n\r\n{boundary}--\r\n"""
Content-Type: application/pdf\r\n
{data}
\r\n{boundary}--\r\n"""
r = requests.post('https://apip.ecoledirecte.com/v3/televersement.awp?verbe=post&mode=CDT',
headers=headers,
data=data_binary
......
fichiers;dates;classe;message
Evaluation0a.tex Evaluation0b.tex Evaluation0c.tex Evaluation0d.tex;2020-09-08;2H;
01_ensemble_de_nombres/raisonnement_absurde_un_tiers_nest_pas_decimal.tex;2020-09-18;2H;Démonstration exigible 1
ensemble_intervalles.article.tex ensemble_intervalles.presentation.tex;2020-09-11;2H;Ensemble de nombres
ensemble_intervalles.article.tex ensemble_intervalles.presentation.tex;2020-09-10;2H;Ensemble de nombres
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment