Open pschatzmann opened 4 years ago
Add file upload:
import requests
def Upload_File(): fle={'file': open('max.gcode', 'rb'), 'filename': 'max.gcode'} url='http://localhost:5000/api/files/{}'.format('local') payload={'select': 'true','print': 'false' } header={'X-Api-Key': 'FD550BD4DA2442BA906AD1850539D6DB' } response = requests.post(url, files=fle,data=payload,headers=header) print(response)
Add file upload:
import requests
def Upload_File(): fle={'file': open('max.gcode', 'rb'), 'filename': 'max.gcode'} url='http://localhost:5000/api/files/{}'.format('local') payload={'select': 'true','print': 'false' } header={'X-Api-Key': 'FD550BD4DA2442BA906AD1850539D6DB' } response = requests.post(url, files=fle,data=payload,headers=header) print(response)