I'm Trying to upload file using REST API with python request lib what was i currently doing is
def Upload_File():
fle={'file':"j:/max.gcode"}
url='http://localhost:5000/api/files/local'
header={'X-Api-Key': 'FD550BD4DA2442BA906AD1850539D6DB' }
response = requests.post(url, files=fle, headers=header)
print(response)
The response return status as 400 [Bad request ] !
Working env :
windows
octprint running on virtual env .
How do i pass file in API Request ??