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

Le PDF est binaire

parent d1a1caa0
Pipeline #339068 failed with stages
in 3 minutes and 9 seconds
......@@ -52,10 +52,10 @@ 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:
with open(document,'rb') as f:
data =
headers = {'Content-Type': 'multipart§/form-data; boundary={boundary}'}
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
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