[Python] Upload cert file using python API

Discussão em 'Python' iniciado por Stack, Fevereiro 4, 2025.

  1. Stack

    Stack Membro Participativo

    How to upload a cert file using python API. I have some input data to pass along with uploading the file. I am using the api code as below-

    url = 'https://someurl.com/'
    data= {'operation':
    {'Details':
    {'AccountName': 'Example1',
    'Owner':'root',
    }}}
    files = open("filename.txt", "rb")
    response = requests.post(url,data, files={"form_field_name": files}, verify=False)


    when the above code is executed, I get the response[200] as output, but the file is not uploaded. Can someone help me to figure out what am I missing here.

    Thanks in advance

    Continue reading...

Compartilhe esta Página