I'm having a zip file that needs to be uploaded. When I use the CURL command, it is uploading it but when I try the same using Python Requests, i get HTTP 405 Method Not Allowed
.
The zip file is usually around 500kb.
Curl command -
curl -u<username>:<password> -T /log/system/check/index.zip "<target URL>"
Python Script (tried 2 different ways) -
1:
import requests
files = {'file': open('/log/system/check/index.zip', 'rb')}
r = requests.post(url, files=files, auth=('<username>', '<password>'))
2:
import requests
fileobj = open('/log/system/check/index.zip', 'rb')
r = requests.post(url, auth=('<username>', '<password>'), files={"archive": ("index.zip", fileobj)})
Am I missing something obvious?