0
curl -v -S -k -u 'user:pwd' -X POST -H 'X-USER-SERVICE-NAME:usertenacy' --form 'data=@manager_logs.zip' "https://testservice/serviceapi/logan.uploads?uploadName=param1&appendUpload=param2&logSourceName=param3"

How to use pycurl to resolve this curl call above?

Thanks a lot.

kaan bobac
  • 729
  • 4
  • 8
  • 4
    What have you tried so far? – bfontaine Oct 19 '18 at 08:09
  • curl_instance = pycurl.Curl() curl_instance.setopt(pycurl.URL, service_url) curl_instance.setopt(pycurl.CAINFO, certifi.where()) curl_instance.setopt(pycurl.USERPWD, user_pwd) curl_instance.setopt(pycurl.POST, 1) curl_instance.setopt(pycurl.POSTFIELDS, data) curl_instance.setopt(pycurl.UPLOAD, 1) curl_instance.setopt(pycurl.HTTPPOST, [("data", (pycurl.FORM_FILE, "messages.txt"))]) curl_instance.setopt(pycurl.HTTPPOST, [("parameters", data)]) curl_instance.perform() – yuanhang sun Oct 19 '18 at 08:17
  • Please use the `edit` button to add this code in your question, and explain how it doesn’t work and what you have tried to fix it. – bfontaine Oct 19 '18 at 15:15

0 Answers0