bensteUEM / ChurchToolsAPI

Collection of Python files to use the API for ChurchTools
6 stars 4 forks source link

Check if commented code is obsolete #48

Open bensteUEM opened 1 year ago

bensteUEM commented 1 year ago

There is a codeblock in def file_upload(self, source_filepath, domain_type, domain_identifier, custom_file_name=None, overwrite=False):

        """
        # Issues with HEADERS in Request module when using non standard 'files[]' key in POST Request
        # Workaround for ChurchTools - generate session with /api/whoami GET request and reuse it
        # Requests module usually automatically completes required header Params e.g. Content-Type ...
        # in case manual header e.g. for AUTH is used, headers don't auto complete
        # and server rejects messsages or data is ommited 
        # Error Code 500 is also missing in API documentation

        headers = {'Authorization': 'Login GEHEIM'}
        response_test = requests.post(url=url, headers=headers, files=files)
        #> this fails !
        """

This might be related to previous CSRF Token issues - can this be removed?